make EventMiner singleton, and refactor test code