JSHint and Grunt

This pull request adds Grunt and JSHint and fixes all files to pass (including a small refactoring to retrieve the correct bundle name). Sorry for the indentation diffs.