World number one Rory McIlroy has announced a break from golf to prepare for a legal battle with his former management company.