refactor server process(), clarifying code and fixing bugs

* Eliminate bogus metrics right up front.  Warn and drop them.
* Rename variables: data, fields, bits, bit... lots of overly
  generic names.  Instead, produce four clear variables: key, value,
  mtype, and rest.
* Break the big if/else's clauses into distinct functions to be
  easier to read on their own.
* Avoid some type mismatches.  Previously, an Int could end up in
  what would otherwise be a List of Str.