WIP Database work

Fleshing out DB connector.
Writing utility methods to ease the programming in other parts of the
code.
Strictly WIP, not ready for real use yet.