RANGE_QUERIES was completely wrong. And in fact this whole idea of a global list of queries to modify is really ugly, so invent a new expanded representation for paths and do that instead.