Add jshint and clean up the code a bit