Organized BVH traversal code to be a bit clearer.