Implementing cache support in client-side js and tweaking the pub/sub code a bit in preparation for better way of doing that.