unit tests in separate database
separate db functionality in separate namespace
separate db functionality in separate namespace, minor fixes