Fixup raw types
Add more lookup methods
Implement persistence

This (rather large commit) adds a databases layer primarily.  Components
are further decoupled with queues.