client-test: various improvements and cleanups