Parses indented tree into array grouped by "parent" key