Fix Gruntfile and add Javascript tests to JSHint
Improve Javascript code quality.