Except for the weird lighting, I now have weird refraction! It's like it's refracting too much :/ and I also got some pixel artifacts, which is odd for something that's calculated for each pixel X(
No pseudo code untill the stuff actually works! hehe gotta have to edit all my posts when this is done. Spiff it up a bit!
EDIT: I changed the way the background color is applied. Instead of starting with it, I only apply it to rays that don't intersect something. This is more correct sinc rays that endlessly (until max_depth is reached) reflect and/or refract never "touch" the background and shouldn't get the background color.