Support unary minus on terms.

Previously, the unary minus (negation operator) only worked on numbers.
Now it can be applied to entire terms.