implements Interval coercion

Interval coercion is missing and it's an issue for one of our applications.

I implemented it as everything was already ready for that and added a test case.