allow configuration of serialization behavior, closes #1304