Simple JavaScript event emitter