Final refactoring.

Adds missing quicksort implementation with a callback.