Initial testing infrastructure

Slight rearrangement of directories to support tests. Add some initial
tests. Tests can be run using scripts/test.sh. Note that an Uncaught
TypeError results when the tests are run that can be safely ignored for
now. A fix is in progress.