[monitor] Cleanup code.
[monitor] Add functional test skeleton.