Quicksort in Javascript