Split logic into separate scripts.
Refactor for performance when lots of branches.
Make more robust in various situations where one of the remotes might be missing or disconnected.
@janthony @msanders This is mostly an FYI that I am checking in my rework of the github bridge.