rename sorted_by_size to sort_by_size; alias sort_by_count; add more to_text specs; refactor to_text; support to_text after sorting