Add JSHint hinting.

This is also added to the test script, so builds will fail if JSHinting
fails.
Fix JSHint errors.