Cite: Parse <references> content all the way to DOM.

* Thus far, <references> tag content was being parsed to
  stage 2 and merged into main pipeline. This patch takes
  this all the way to DOM. This required some tweaks to
  handling of <ref>s nested inside <references>.

* Fixed up a buggy parser test in the bargain -- the old parsoid
  result was buggy as well. I verified output in the enwp
  sandbox.

Change-Id: Iff6c528066b71ce1b00dd769910a04ee66623340
Merge "Cite: Parse <references> content all the way to DOM."