Refactor sort_and_reduce()

No need to set excluded_relays.nick and total_relays.nick every
time. The last time alone counts. Let's move it outside the for
loop.
Make more changes to sort_and_reduce()

* Add space after comma
* Make it more pythonic