create test fixture to reduce duplication

There was a lot of repeated boilerplate in all of the tests
wrt setting up the database, server and cleaning up everything
on teardown. This has now been moved to a support module