Initial 4D version of stage 5

I decided to start with stage 5 in 4D since I'm not quite ready to build
a 4D BVH. Once 4D stage 5 works really well, I'll figure out how to do a
4D BVH.