Eliminate redundant work in the quote minimization pass

* Quote minimization code was doing redundant passes over the
  same dom-tree when skipping over text nodes -- in the worst
  case, this used to cause exponential behavior.

* Cleaned up the min_a and min_b flags to more accurately reflect
  progress when DOM has not changed because of combine or swap.

* This fixes serialization times on pl:Zarazowate and it:Poposaurus
  which used to take 944 and 569 secs respectively in rt-testing.

Change-Id: I901034e70ba0c88e3ede61c517b62c85ea80226e
Merge "Eliminate redundant work in the quote minimization pass"