Automatic integration testing

Subject to cleanup, but otherwise complete (#627)