Grunt: Add JSHint support.
Remove unused functions/variables.
Fix most JSHint warnings.
Enable JS strict mode
Fixes #285
Fix the remaining JSHint warnings.

Also enable a few more JSHint checks.
Run `grunt`.
Add the JSHint check in the test target.