A InsertionSort algorithm
The sort maintains a sorted (left) and unsorted (right) sections. As each
value is checked, if it's greater than the previous value it gets swapped
to the left until it is no longer greater.
array
(*[]): the input array[comparator]
(Function): a function to compare2
values *(defaults asc->desc)*[step]
(Function): an optional function that gets applied at each step
(*): the sorted array