Implemented constant folding for integral expressions

nit: You can leave off the parens for get* and other calls without side effects.