Added .jshintrc preferences
Fixed some jshint warnings and errors