Added Joined-Q-Interval manager.

Now it should be easier manage joined-q-intervals using add_q_interval and
get_next_interval.