DBConnection implemented and tested

Super messy, but hey, it works!