[count_inversions] Add algorithm to count inversions

Given a sequence of sortable items, it counts the number of inversions from
the (ascending) sorted order.

Piggybacks on included custom mergesort.
[count_inversions] fix mergesort_and_count return val if len(sequence) == 1

mergesort_and_count returns a tuple where the first element should be a list
containing the input's elements in (ascending) sorted order. It had a bug,
where if given a 0-or-1-element tuple or string, it would return that
0-or-1-element tuple/string instead of a list in its return tuple. Fixed it.
[count_inversions] Make mergesort_and_count function public