The bug was that while iterating a Region during the gate traversal,
the "select_interacting" was triggering a sort() which changed the
order.
Solution is to pre-sort when iterators are issued also when the
iterator is non-region selecting. This way, plain and region query
iterators can be used together. In addition, the dirty flag scheme
of Cell+Shapes was cleaned up a little for bboxes.