Move ray / box intersection test to math library