Add shim for missing window object in JavaScript context

Workaround for https://github.com/jshint/jshint/issues/1038
Add root cause to exception when checking library
Upgrade to JSHint 2.1.2