Added database contract & helper; test project

Test project contains a pair of fairly trivial tests. The database
helper's test in particular is (virtually) unnecessary: it only checks
the helper returns approximately the expected database.