Setup the DB for templates

Add a schema for the templates table. Create a library for
creating and retreiving templates from the database.
Fetch the info about a template when visiting the apropro edit
page. Add a nifty little box to view the templates in.