Factor messaging codecs into core [TORQUE-1030]