Compatible with facebook HHVM 3.1

This patch to make HTML5 compatible with HHVM contains also workaround to avoid this https://github.com/facebook/hhvm/issues/2962
Shouldn't iterating over the child nodes be done by the traverser? Why was it moved into the output rules? I'm also curious what TEXT_RAW is a special case.