Create database and tear down/recreate at end of each test. Fixes #195

This pull request means that there is always a populated test database that is wiped and re-created at the end of each test. This gets around some issues we've had where a database was required before tests were even run.