Refactored detectOS() to simplify it
Implemented detectLanguage()