Added template update and delete functions.

Also fixed the clean_title method of the TemplateForm.