Refactor common rope concatentation code into a function, add rope-concat method for leaf-concat case