Make planning process more efficient by not sorting the list of matched rules each cycle. It is sorted if tracing is enabled; otherwise we scan to find the most important element. For this list, replace LinkedList with ChunkList, which has an O(1) remove and add, a fast O(n) get, and fast scan.