A simplistic implementation of an event emitter in JavaScript.