add to_hash conversion function ti Interval, + tests