Support new msgpack specification; minor refactoring;