Wraps monitor with category.

Also, move codes around so that the wrapping for the monitor and batch
options get the same scope.
Consolidate monitoring in a single function
Stop and report when rule goes over limits