JSHint tidying

I've been working my way through with JSHint (http://www.jshint.com/) cleaning up warnings. Most interesting is acdha@c54012addb9edc9a77e4e024f65a194e63818910 which actually causes a compile error if you attempt to use Closure Compiler.

Next up would be cleaning up variable declaration and some old usage of ``arguments`` in a way which, AFAICT, doesn't make sense for any browser in common use.