iOS fixes

This consolidates a bunch of fixes that are required to support a wide
range of iOS devices. Note that for this to fully work, one more fix is
required in the app controller of the app that will be using the
angular-jqm framework. For full details of this additional fix and the
iOS test matrix, see my comment in
https://github.com/angular-widgets/angular-jqm/issues/179