Add IEnumerable support to EventManager and CommandManager
Fix threadsafety issue in CommandManager