Speed up unit tests

The database is reset between every test example. Doing it using transactions (that are rolled back) instead of truncating every time makes the tests twice as fast.