Make message marshaling/unmarshaling pluggable