badge fixup code for fixing busted badge numbers

if badge numbers get out of consecutive sequences (like what happened for 8.5), this will re-assign all badges to fill in the gaps/etc
only use this as a weapon of last resort
also, added another check for duplicate badge numbers in the consistency check
In case you didn't know, Python actually lets you do nested tuple unpacking.  So like you can actually say:

```python
for badge_type, (badge_range_start, badge_range_end) in BADGE_RANGES.items():
```