array2tree: support appending to existing tree