Start writing some docs about RPC protocol.

This is only the beginning: unfortunately I just noticed a nasty
bug which I prefer to take of immediately.
Async: remove some unused code.
Async: remove length at the beginning of RPC messages.

This fix a nasty bug that would have been triggered by having
a JSON length that contains the bytes '\r\n', which are used for
message termination. Fortunately our messages are always short
enough that, to my knowledge, this bug has never been triggered.