Move swapNodes() with other private functions
First stab at a mergeSort() function (based on Simon Tatham's algorithm)

http://www.chiark.greenend.org.uk/~sgtatham/algorithms/listsort.html