Refactored to make all messages sent to mediator of form (cmd, msg) and pickled + b64 encoded