Major rewrite of the message handling between transport and agents. Still untested!