Move streambuffer classes into correct files.
Make copy-on-write semantics first-class citizens.