Interval now fully supports more complex types, e.g. TimeInterval.

Interval now takes an additional generic type parameter which is used to
indicate the type used to denote distanced between values within the
interval. In addition, Interval is now immutable.