Add event emitter and trigger() method