Optimizer monitor

Adds monitor object for optimizer classes. This needs to be merged after #270 (and subsequently rebased).