Add write wrapper.
Convert serialization test to msgpack.
Add fake msgpack_istream implementation.