Set up data-mw for all templated image attributes.

* All templated (but not extension-generated) attributes
  get expanded to DOM and generated HTML is added to data-mw
  for editability in VE.

* If a template generates a "|"-separated string, that string
  is split into multiple attributes, and the figure itself
  is marked uneditable by adding a "mw:Placeholder" typeof to it.

  Ex: {{largethumb}} in nlwiki

* A bunch of fixes to serializer to get this all working in
  wt2wt, html2wt, and html2html modes:

  - Renamed getAttributeValue to getAttrValFromDataMW to more
    accurately reflect what that function does.

  - Fixed mw:Placeholder typeof check to correctly serialize
    HTML from {{largethumb}}-ed images.

  - data-mw is present on the outermost wrapper but HTML attrs
    are present on individual internal elements. To deal with
    this, added a new serializedImageAttrVal function that
    uses getAttrFromDataMW and then uses HTML attr fetch, in
    that order.

  - Required some additional tweaking to get templated widths
    correctly serializing in html2wt and html2html modes in
    the absence of data-parsoid (which has optList info).

* Added 2 new tests for templated attributes and tweaked
  existing test that mimicked {{largethumb}} behavior.

Bug: 49400
Bug: 51921
Bug: 54803
Change-Id: I5e4c9a789ef6c2b79b1b0f1ba17cbf8c2218cbd4