Update SQL to use new Database Structure

Experimental, will break things
Merge pull request #4 from haroldhues/master

Update SQL to use new Database Structure