Fix nested mediators

Define each module individually, ident accordingly.
Pretty messy code here :{ down for ideas on how to improve