implement latest version of jQuery-mobile, and some optimisations