WeightedItemsSelector implementation and basic tests