Prune children searches

This change drastically speeds up contents() calls that have search_children=True by pruning the children that a driver has to search through.