Implemented constant folding for integral expressions

that happens if you mix up cpp and scala :)