lots of jshint fixes