Rewrite of RaftMonitor to be a class with test functions