Added some db stuff
Cleaned up tests, should work now