Trying to improve detection of typed characters.

The previous solution did not work with Chrome@Ubuntu.
Moved template helper into util.html.
Fixes in update script.