More cleanup - added some comments, removed some debugging output, cleaned up namespaces.
Uncommented the database reader, and made changes to make it functional again.