Initial work for stdin processing.
Can optionally provide a tag for pinned structures.
Functional stdin processing.
Improved test a bit and added attachments to writes.