Add rand-weighted-selection.

Add a function that, given interleaving weights and values, where the
weights sum to 1, randomly selects from among the values according to
the weights.