Tweak JSHint settings.

I left a few ones as `false` in case someone wants to enable them later.
Add a .jshintignore file.
Update .gitignore.
Fix various JSHint issues.
Use `common.platform` everywhere.
Remove trailing spaces.
Use the shorter `js` to highlight Javascript code.
Use `process.platform` instead of `os.type`.
Fix JSHint redefinition warning.