Make various JSHint fixes

Here's [a list of JSHint options](http://www.jshint.com/docs/options/); I've currently chosen the ones that fit best with our source base, but we can of course change these if we wish to.