Branch visitors for detecting and mutating branches.

This PR replaces #547. The branch has been renamed to correspond to the name of the main file this adds.  I have addressed most of the comments that were still open in #547, and made some modifications that are dependent on PR #551.

Minor nit, but how about saying its value is set to 'non-zero' or 'zero' instead of true/false? The Scope holds ints.