DOM Fragment Unpacking: Bug fixes in hasBadNesting + DOM traversal

* hasBadNesting code had 2 bugs:
  - Wrong polarity on isNestableElement check.
  - Missing special case for 'A' (because 'A' is considered a
    formatting elt, but for our purposes cannot be nested)
  These two bugs cancelled out for what we wanted to handle (nested
  A-tags), but it triggered in some cases for <DIV> tags.

* Fragment unpacking was not returning the right next-node to process
  when unacceptable tag nesting was fixed up after unpacking.

* Together, this caused wt2wt error on this snippet:
--------------------
<div><gallery>
File:Foo.jpg
</gallery></div>

[[Fool]]s
--------------------

  This is a snippet extracted from en:Arch which had regressions
  in RT testing.

  The snippet now RTs and en:Arch now has its regressions fixed.

* TODO: Find a way to convert this into a parser test.

Change-Id: I523730f35082d0dd802ea2194ed71409ba1fe2c9
Merge "DOM Fragment Unpacking: Bug fixes in hasBadNesting + DOM traversal"