Using static vars meant all connections were using the same static vars!
A bug that has existed since 2009!
This code is ugly, but since it is such a fundamental piece of code for
every operation, no refactoring is being done except to convert the
static vars to data members renaming where required to avoid name
conflicts. The one exception is that `cumLen` which was a per hdr.type
variable is now a single data member across all types. Since for a
single connection messages will be sequential this is expected to work
(fingers crossed!)
For the future we should look at replacing the custom RPC code with GRPC
(issue #305).
Fixes#304