fix 2 bugs: n == pivotInd also needs to act on pxs, and median needs to take the length of the list it's passed.
add tests (that all pass!).

TODO: figure out select efficiency (slicing?), figure out median xs scope, write faster partition, clean + comment better