DRY out the regression tests

Builds on top of #130, which should go in first.