Interval tree implemented in python with query options in javascript.