test: Introduce a helper object for various test clients.

Extracted (with modifications) from #501
Probably no need for this to be a pointer.