Add some tests for the database API, using a database mock-up