Fix undefined error and format code

Moved some variable defines around to fix undefined errors.
Formatted code to follow editorconfig.
Merge pull request #19 from truckingsim/bugfix-log-error

Fix undefined error and format code
emptyRequest option not works

Fixes #17
Merge pull request #20 from markcarver/issue/17

emptyRequest option not works
Run grunt
1.2.2 Release gruntification.
Merge branch 'master' into gh-pages