Added weighted median function and tests

Better to use `sum(w)` than `sum(wt)`, since `sum(w)` is computed at the time of WeightVec construction.