Data structure representing a long string as a tree of separate substrings to permit efficient random insertions and deletions