Reworked to support JSON broken into chunks

* Added random splitting into chunks to the test backend.
* Rewritten the frontend networking part to support JSON received in
more than one chunk.
* Added documentation to the refactored frontend parts.
Just for logging, to see these characters as "\n" and "\r" on the output, and not the actual newlines and caret-returns.