Did some refactorings, adding grunt, beautified, fixed jshint warnings