full package with tests and testbed for gathering performance data. Corrects a previous bug in the share distribution, where randomness was badly randomized.