Factor out PR handling into a separate function
Factor out PR handling into a separate function

This makes the overall org + repo handling easier to read, and will make
the code testable as well, although more refactoring will be necessary
before we're able to write small, targetted unit tests for this
functionality.

google/code-review-bot,google/code-review-bot