Reduces the average runtime of building mesh PBVH nodes from 4.2 to 3.3 seconds in a basic test with a 16 million face grid on my hardware. This is probably mainly because of improved inlining with C++ templates. It also makes the code easier to understand.