Added DB abstraction layer with test