Database abstraction layer.

This is the only reasonable way to handle multiple database backends.
It is not designed as a standalone solution, rather as minimal wrapper
as possible. Finally having consistent and defined database access
API, the admin implementation can be simplified a bit.