Add untested groundwork for the new ray casting callback system.
More untested work on the new ray casting callback system.
Fix some issues with the new ray-test callback system.