Basic db stuff is there now. . . needs testing.