templates allowed anywhere!

* templates no longer specific to crafts
* no need to separate crafts from templates - if an entry in the crafts
  section looks like a template, it is a template
* split database logic into smaller, somewhat decoupled units
merge templates into crafts
some tests
fix templates for non-crafts