code cleanup

* wrapped node modules in immediately invoked function expression to
  preserve global vars and protect against accidental scope leak
* added .jshintrc file
* cleaned up code to match .jshintrc