gerrit_changes.py: Major refactoring