Add jshintrc and fix some issues