Merge new database structure

Merges updates to the database plugin for more efficient type storage.