Clean up using C99.
Added/extended local optimization rules.

(C1 - x) + C2 = (C1 + C2) - x
C1 - (x + C2) = (C1 - C2) - x
~(x + C) = (~C) - x (extended from ~(x + -1) = -x)
~(C - x) = x + (~C)
-(x + C) = (-C) - x