Fix path tracer to not  be recursive.

Tweaked refraction too. Not sure if this is correct yet.