Save the template, enforcing parent/child invariants.
If parent is set, it must already be saved.
All children must be Template instances and saved.
_children_order is updated from children.
_master is derived from whether a parent is present.
Any configured _properties are merged into
params['properties'] before persisting.