First draft of the db_handler with some tests.