Various sorting algorithms implemented in JavaScript