Minimal but versatile JavaScript pub/sub working everywhere