Add database layer interface and rudimentary test, still more to do with it.