Added purge function to support a canonical factor representation.

With this canonical representation subtraction is usually the inverse
of addition (some constraints still apply).