Fix various issues with constant condition elimination
It used to optimize based on the initial values of variables, ignoring
the fact that they may change between loop iterations. A stop-gap fix
was implemented in
8e14c29, but it prevented optimizations of some
conditionals that could safely have been removed. It also caused the
optimizer to ignore any assignments made to any variables after
declaration when evaluating the loop condition, potentially causing
entire loops to be erroneously removed. Finally, unary expressions were
not being handled so ++ and -- operators did not mark the variable as
modified.