Avoid Recursion 

This fixes some recursive code called during dendrogram plotting, that can break the default recursion limit.

This also renames get_sorted_leaves to sorted_leaves