Ranking: add ranking logic for all races + tests.