Switch to more generic model handling

I started implementeting other document types and quickly realized that
I was going to be repeating myself a lot.
Add project model and components

Every card must have a project. This commit does not include the form
compont for creating a project.
Temporarily put the db in the global namespace

This helps with testing from the console.