Interval tree clocks for Javascript