Case branches can depend on scrutinee

When constructing the case expression, if the scrutinee is a variable in
the environment, use that as the argument to match on, rather than the
new argument we've constructed (which we should still keep, just so that
we can still use the name if necessary).