collect_leaves function

Collect leaves of a TableTree