jshint fixes

Here are some jshint fixes. There are many more but I'm not sure if we want to fix them (style-related). I suggest you also run jshint on the javascripts and see if there are any others we want to fix.