Extract scale() into AMD module and improve

This correctly applies a pseudo-landscape transform if the
screen <= 640px wide, to cover situations where we are on
a device which doesn't support screen.lockOrientation()
but which is too narrow to show the app at a reasonable size.

However, I'm just parking this for now, as hammerjs (the gesture
library I'm using) doesn't give correct drag deltas if the
drag events occur inside a translated parent.