sort environment objects by category, display category headers