Changed the way we detect mobile devices

The old one didn't work with tablets at all so we were forced to.