Refs #6849. Adding affine matrix saving.

This necessitated making a template version of the matrix saving code, so the
W transform daving routine changed to match.
Refs #6849. Actually use new function.
Refs #6849. Trapping when no affine matrices present.