Move expression reordering in Ors from query graph builder to ast rewriting