First commit of mediator, rewriting tests.