unify visitors for if and loop statements

This addresses the issue I noted in #10 as well as closing a longstanding TODO (handle `else` clause of `for`).

It also adds the support for global constructs (that `loops` had) to if statements.

The core insight is that if statements are not really different from for loops in structure, so I've refactored such that they reuse code. In the course of events, I factored out the misfeatures of the two code paths.