Simplify database structure

The original ambitions for the project were too lofty. Now it's been
simplified, starting with the database core. Simple, effective and build
from there.