QuickSort implementation and some minor general modifications.
Including MergeSort algorithm.