Add test apparatus, Fixed #8

Still more work to do on high-level test, but the low-level stuff is there, which is fine for now.