Jshint cleanup

Fixed most warnings emitted by [jshint](http://www.jshint.com/) on the source tree.