Move platform detection into utils.