add new Interval class
add unit tests for intervals