simple object listener / notification in JavaScript