add 'template_or_serialize' to mutable serializer

Fixes #525