New version of database tables and db module

Reorganized the database adding many fields and connectivity. Database
management module to go with it. Old tables and db module kept for
future migration of database to new version when ready.