Moved detectOS to utils.