Optimizer monitor

Adds monitor object for optimizer classes. This needs to be merged after #270 (and subsequently rebased).
Oh damn, good spot.  That would have been funny.