Allow for custom encoder/decoders for the messages, also added some documentation.