Refactors tracef and sampler
Refactors tracef and sampler

Extracts the reflection code from sampler and the masking code from
tracef, simplifying the overall complexity of these functions.

dcousens/RayTracer