Upstream can write any object, not string only

* Now upstream takes an object, packs it with msgpack, and then sends it.
* Also added functions to easy unpack an object packed in chunk.
* Deprecated API removed.