(Bug 64747): Bug fixes computing transclusion dom-range

* Fixes crashers on all pages listed in the bug report.
* Fixes crasher on the test snippet in the bug report as well.
* Added a new parser test (and tweaked our native expansion
  pipeline to strip out "" tokens from parser fn. output
  so that its output is still empty).

Change-Id: I07ffcd85986ffa683d70927d2314c2c5d22b3f97