HasRep for sums
handle constants again, including undefined
simplify undefined: always zero
tweak defines