Rewritten insertion sort in a way that it is now really based on
insertion, rather than a kind of bubble sort as it was because of being
too closely based on imperative pseudo-code of handbook.