Implement EventMgr and fix regression which broke AI loading