new tree_as_array() dumps the tree into a multidimensional array