Initial work on the db engine.