Lots of JSHINT fixes (very few bugs)