Use regexp to test typeof in generateReferences dom post processor

* {{#tag:ref | foo | group="nb"}} was parsing to empty content since
  the ref-tag generated by this transclusion had mw:Transclusion as
  well as mw:Extension/ref/Marker types and was not being processed
  because of "===" for comparison.

* Fixes regression on en:List_of_people_claimed_to_be_vegetarians.

* Unrelated: Fixed JSHint warning about a bad regexp.

Change-Id: I646d598e46c59d364a605a3209c9a827f59a126e