Added statistics for each event ever fired or registered
Moved erm memory dumping code to a separate function