End and Home buttons go to beginning and end of word
Kludge to get OSK working on device

There's no way to tell the device to open the on-screen keyboard (LP
and set the focus on that whenever we want to keyboard present.

BUT -- we can't set this to 'display: none', or else the OSK doesn't
appear.  And we can't make it zero pixels big, or the HTML5 container
crashes.  So, we make it a pixel large and hide it in a corner.

BUT^2 -- keydown events (and the like) are not generated for most keys
on the OSK.  (They are for Delete and Enter, curiously.)  So we also
listen to the input event on the focuser, to see when its contents
change.  When they do, we take action and clear the input.  Since the
keydown handler calls event.preventDefault, this only gets called when
the keydown event is missing, which is what we want.

BUT^3 -- the input event is triggered twice for every keypress.  I have
no idea why.  So we key a record of the last character entered to avoid
these second events.

BUT^4 -- spaces generate only one event, so we exempt them from this
restriction.

In short, this whole thing is incredibly fragile and likely to break if
you look at it wrong.
Kludge to get scrolling working on device

While you can drag to scroll the whole page, you cannot drag elements of
the page to scroll them (LP #1296468).  So we implement this ourselves
with the hammer.js library.  Note that we're counting on the scrollable
elements not having borders or transitions.