organize flatten function to be more readable; order treetable properties so those without children display first & those with null or empty children dont display