Added a hook for substituting serialization logic for message bodies