Save files while updating a template.

When updating a template object, any updates to the files must also be
saved in the database. With this change, updates to files of a template
are also saved in database.

Change-Id: Ia5b84780158c47ffe807829ce2fc83f4ffbb6db3
Merge "Save files while updating a template."