Added EventEmitter, refactored Globals variables