Simple JavaScript object event emitter and listener