real: adapt to use the new integer and rational, and
major improvements in features.

This is a rather large chunks of changes, which needs to be properly reviewed.
Things are missing, but it does compile and run the existing tests.