add intersect method to Interval class
ignore coveralls build directory
refactor Interval class to avoid duplication