Added DB support. *yeah*

Some regretions in the testing. 5 failing tests.
Well... Better than nothing.