Minor JS changes after jshint, added a postinstall npm script to install the pre-commit hook into .git/hooks