Add appropriate regression test suite

Still untested, but the promise of far better coverage.