Convert eventEmitter to object and add broadcast function