Add jshint task.
Fix syntax problems.

Problems, revealed by the jsHint.