Added Grunt for js linting. Small refactorings.