database and tests

still wip