util.js: fix timer to not be global

Fix an issue with concurrent animations by making 'timer' not a global.
In further work, find out about JS's 'strict mode' to avoid this sort of
blunder.
Enable strict mode and fix up issues

Put the "use strict"; statement at the top of each .js source file to
catch silly mistakes.
Make js more jshint-friendly

Run JSHint over the .js source and fix up most complaints.