Moved the ray tracing stuff to it's own class