Add prototypal version of median