extract a common code module, implement an mxbean to control pausing, adds a test to make sure it pauses