Moves out all stub db related stuff

This is to avoid to have to push the db_handler itself, when we just want to fill in new stub entries for testing, as this is purely development related.