Added necessary const flags
Switched to glib types, specified type length, added SQL-like unique id to each template.
Merge branch 'template'