Improved database classes and added some tables.