Client protocol implementation

Since preliminary testing by @nuft indicates that this implementation works (see 6ec4e534fd6146017c91356184fcf4f11ce081e5) and pylint is pretty happy with the current status of the code, I think we can merge it.

@nuft anything you would like to change before merge ?