fix jshint warnings, some cleanup