Added weighted median function and tests

I think it would be equivalent but more efficient if you compute `maxval, maxind = findmax(wt)`, check if `maxval > midpoint`, and if so, return `v[maxind]`.