Add control loops

A humble first attempt to provide a mechanism for feedback loops.