Convert messages to envelopes and bodies.

Closes #120.