Fix most JSHint complaints
Merge pull request #499 from galfert/fix_jshint_complaints

Fix JSHint complaints