Refactor.
Added negation.

Also found some fatal bugs in the reduction code: (0-x) does not equal x.