A data structure for efficient manipulation of sets of intervals