Add jshintrc for javascript code quality.
Formatting and linting improvements.
Add predefinitions to jshintrc and improve formating/linting in the other scripts.