Constant optimizations

Things that are shady:
Haskell uses 32bits ints, so when the constant folder folds 1 >> 3 you get unexpected results.
Constant folding may fold constants on the left side of an operator that can't handle it. Don't write constants on that side :)