Extract `Message` implemenation details

Now it should be possible to use as a generic P2P library.