Add copy-on-write string and tests for it