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.
The check should have been `if (start === undefined)`, not `null`, to begin with. I like `== null` however, because it's shorter.