Rewrote handling of GGP pattern re-ordering based on the algorithm in the SPARQL 1.1 spec.