Refactor for safer protobuf streams; add ROOT