First version of db complete.
I included some notes about how it works around line 80.  I included a test db if you want to mess with that, or you can delete it and add your own data. If you have suggestions/comments, let me know.