Added a first draft of an 'is_sorted' function for lib.math.