All this boilerplate code, plus what's at 47-52, should really go in some kind of testrunner.js file or the like that we can reuse.