moved expression generation into Operation struct to allow default behavior to be overridden, simplified constant generation code