MDL-63044 javascript: add simple pubsub implementation