Require vars to be defined before use, to prevent hoisting bugs
Move a late define of a server variable found by jshint
Merge pull request #35 from dmose/jshint-latedef

Turns on the "latedef" switch for jshint to prevent time-wasting bugs.
code reformat
sync with master
call accept/deny events