Unit tests

First stab at writing tests (see #87).

This gives a node.js-based test setup so that we can run tests from the command-line. The makefile has been updated with a command to run tests.