WIP collection and db

I've opened this mostly in case somebody is working on something similar, so we don't collide!