.jshintrc, js code cleanup

Added `.jshintrc` with some default values.
Cleaned up `js` code accordingly to `jshint` preferences.