Factor out the generic random weighted choice algorithm from random_level.
Add stats for races.