Parametrised intervals

Interval arithmetic rewritten to use parametrised intervals.
Tests pass.
Instead of `x == int(x)`, I think it is better to use `isinteger(x)`.