Add .jshintrc and make a bunch of fixes