Add possible debug code do sread()
Add shallow_copy() and use it in ToTree stream sink

Previously, the ToTree sink would add the nodes it receives into a
tree, no matter where they came from. This causes parentship issues
and is not quite nice.

Now, the sink checks whether the nodes are un-owned, and if so, it
uses them. If not, it creates shallow copies and uses these.
Do not perform empty reads

These may block, which is undesired. And they're useless syscalls.
Work with StreamSink instead of raw StreamSinkIntf pointers
Improve member_record serializer
Add an option to throw on unknown records in a struct
De-enumify RecordType, to allow for castless extensions
Create base template for Enum records