Further fixes to DOM Fragment encapsulation + unpacking

* Fixed figure expansion reuse to go through the same helper
  function (encapsulateExpansionHTML) like all other code.

* Added isForeignContent flag for reused expanses (transclusions
  and images). This is also used to discard excess span wrappers
  on non-foreign content dom fragments, and fix about-ids on
  foreign content dom fragments.

* These fixes now eliminate about-id manipulation during fragment
  unpacking. This fixes regressions on fr:Vasco_Evtimov and other
  pages that showed regressions in RT testing.

* Fixed DOMFragmentBuilder to use the refactored helper in
  Util.js for processing content in a sub-pipeline.

* Added parser test to capture the last scenario.

Change-Id: I348f80817dfcd60768171b98d698a0733d4e6e79
Merge "Further fixes to DOM Fragment encapsulation + unpacking"