messages module

this module can pack and unpack messages of protocol. Untested.