Add device detection for different panning behavior

The previous commit caused strange behavior on Android devices, so
we'll have to do some device detection. The PhoneGap API includes a
'device.platform', but it only causes the app to hang (on iOS), so this
commit includes an Unholy Marriage of Regular Expressions and User Agent
Strings.