Fix badge renumbering

Completely rewrites the badge renumbering functions.

The primary goal was to make badge auto-numbering work when badge shifting was turned off, as it was assigning duplicate badges in some circumstances.

Secondary goals were:
- making the function easier to read
- removing shift_custom_badges check from the shifting function and instead preventing the function from being called unless shift_custom_badges is true
- automatically renumbering badges back into their range, even if some badges of the same type are out-of-range
- keeping the logic about "which badge is actually considered 'next'" in the next_badge_num function, instead of tacking on adjustments after calling it
Reading this line of code, it's not immediately obvious what this second parameter is, which can be confusing for a new person coming to the code.  Sure, they can look it up by finding the ``next_badge_num`` function, but to save someone from having to do this, I like to make these into keyword arguments.  So instead of saying

```python
self.session.next_badge_num(self.badge_type, 0)
```

we could instead say

```python
self.session.next_badge_num(self.badge_type, old_badge_num=0)
```

which instantly conveys what that argument is.