Add some tests which exercise database functions