Cleaned bvh code.

The termination criteria should be clearly improved. It ends here with one
triangle per leaf