Implement term comparison predicates

The implementation is based on term.Precedes() which was already
implemented for msort/2.  The ISO test suite found a couple problems
with our comparison implementation:

Rationals must always report themselves as floats.  Otherwise, 1.0
behaves like an integer which causes `1.0 @< 1` to fail.

When two number terms are numerically equal, ISO and SWI-Prolog both
sort the floating point number first.  This seems silly to me, but I
see no compelling reason to buck the consensus here.