Added weighted median function and tests

"OTOH, this could introduce type stability with some AbstractVector types (e.g. ranges) so maybe better to leave things as is."

Which comment does this refer to?