Introduce bufferpack.

Bufferpack is a much easier and less error-prone way of packing and unpacking
messages than writing similar logic by hand.  Hope that we don't mess up string
encoding though...