add weighted reservoir sampling (AE-S)

Implemented algorithm A-Res from http://utopia.duth.gr/~pefraimi/research/data/2007EncOfAlg.pdf, offering a reservoir sampling algorithm with the chance of each element being in the final sample being proportional to the (positive) weight assigned to each element.
If need arises we will fairly easily be able to implement A-ExpJ using this (but I don't think we'll ever need it) to save some random numbers.
The careful reviewer will observe that really I would have wanted a priority queue instead of an abstract heap (to get "peek") but in this version the exposition is clearer and the performance hit isn't more than a slightly worse constant depending on the reservoir size.
A-Res will be used to generate the split key when it is needed, taking the size of key-value pairs as their weight. Other metrics are possible, allowing for a range of interesting split key criteria.
Well this appears to test the algorithm properly, so I must have missed something about what's going on. Ah, I see now that it's a random number 0 <= rnd < 1, so taking to a smaller exponent makes higher weight yield higher values. Cool.