Grunt automation improvements

- Add an initial validation step for faster feedback on syntax errors.
- General tidy up and consistency improvements.
- Add a setupdev task to automate adding a git pre-commit hook.