livedata client: Factor out "stringify message and send it" into a helper.

(Extracted from ddp-pre1 branch.)