ControlPlaneClient cleanup

Fix unit tests
Enhance JsonEncoder/Decoder