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.

This is an interesting idea, at first I thought it was not possible because for if's we need Stmts, and for select's we need Exprs. But I guess I could just store an IRHandle in the stacks and covert them to Stmt or Expr in the appropriate visit nodes.

Originally, these two cases (if v. select) were handled in separate classes, so some of the way I was thinking about this visitor was left over for then.

I'll see what I can come up with.