Templating

This adds an optional template system, based on role and category, that allows fields to be re-ordered or omitted from the display, and controls display of edit and link buttons