Factors out DOM traversal, keeping the code in `parallel` free of traversal-specific logic.

DOM traversals and Flow traversals look very similar. This patch unifies them
with the preorder/postorder pattern. Hopefully, it also opens the door for writing
the traversal code only once, instead of the duplication we have today.
Update web-platform-tests.
Merge pull request #3638 from cgaebel/parallel-dom-traversal

Factors out DOM traversal, keeping the code in `parallel` free of traversal-specific logic.
auto merge of #3641 : Ms2ger/servo/wpt_20141010, r=Manishearth
try to reset flows which need reflow, since reflow isn't yet idempotent
first pass of fixes