Lots of cleanup, but mostly distributing functions/methods to correct files.
Also use stl containers in monitor definition.