Add jshint.

And remove an anonymous function declaration from a for-loop to pass
jshint tests.