Add d3.weightedMean.

Tried to avoid overflow cases when it made sense.