Remove trailing spaces and use spaces consistently.
Add JSHint support.

Use npm run check or npm run lint.
Fix a few JSHint warnings.