Clean up treeview display code to be simpler and more consistent with the rest of the filtering code.