Abstracted node relationships in the BVH to functions.

This will make refectoring the structure of the BVH easier, without
having to rewrite the traversal code.