Consistent procedures for cluster tree estimation and pruning