Initial import of database tests - exercises the db_api, more to come.

Change-Id: I41c6ad35b1491938f253374e22807220fecdfcb4