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 
seems fine if you prefer to do that. maybe put this comment in the code so it's clear?