Add db creation function into the db module

Also add a first, trivial test for that module.