Add sorting algorithms
Fix sorting tests