protos - package defs and message codes
fixed check message bug
replaced two copies with moves
fixed some signed/unsigned comparisons in CHECKs