Port configure script to Node, step 3: run JS tests.

This is step 3 of porting our configure script to Node.  Now that the
PhantomJS dependency can be managed well, this version improves on the previous
by adding a `test` target that runs the tests on the command line.  Generating
the tests for running in a browser is still done by the `tests` target.

Progress on #7.