Simple blueprint for a JavaScript publisher/subscriber pattern