Modular controller v0.4

this is the v0.4 version of the modular controller code.