[TIMOB-16386] [TIMOB-16421] Refactored the Visual Studio and Windows Phone environment detection to be more bulletproof.
[TIMOB-16386] Finished updating the hooks to use the updated detection system.
Merge pull request #5397 from cb1kenobi/timob-16386

[TIMOB-16386] [TIMOB-16421] Refactored Windows environment detection