Fix variable definition errors found by jshint

This includes an update to the test runners, which now use a separate jshint config with expanded globals for tests.

@mwhite 
and here