simple object pub / sub in javascript