Replacing the insert method in sorting.

It has been replaced with a binary search, instead of
an insertion-sort O(n^2) search.
Style cleanup, vars, etc.
Simpler binary search implementation which does not special-case length=1.
History.md update.
Merge branch 'pr/969' into devel