Use utils/allNodes in dom/fragment

This changes `dom/fragment` to use `utils/allNodes`, to make it more DRY. It also allows a `context` parameter for `utils/allNodes`.