Improved Grunt workflow, some JS refactoring.