Un-revert rewritten median to use std::swap rather than std::nth_element