Reduce duplication in the serialization tests -- refs #1564