Moved detectOS to here.