Begin server-side functionality for updating a template.

This turned out to be a little more complicated and messy than
anticipated. It's not finished yet, so the code that calls this
functionality has been commented out for now. The commit is merely to
show progress on this front.