Adding utility functions for detecting and manipulating branches.

This PR pulls out some of the helper routines from the specialized_branched_loops code in PR #482 and provides some correctness testing for these visitors and mutators. These functions might be useful in other contexts, but the main reason for pulling them out into their own file is to help the readability of the specialize_branched_loops code, and make it easier to test them independently.
The pattern here seems to be: normalize_branch_conditions makes a mess, and then prune_branches cleans up after it. This is an OK pattern, but better to keep it private within the cpp file if possible. If prune_branches should always be done after normalize_branch_conditions, then only one method should be made public in the header, and it should normalize and then prune.