improve control client with length based message framing

Other minor tweaks