Raytracing update

@bit-pirate @stonier 

Additional unused code removal and formatting comes later after first checking..