Issue #2645740 by hussainweb: Replace tree_table with a render element and simplify other theme functions