Refactors tracef and sampler

Extracts the reflection code from sampler and the masking code from
tracef, simplifying the overall complexity of these functions.
Uses case statement instead of nested if
Simplifies pm/pt calculation and removes excessive indentation
Fixes missing reflections of other spheres
Fixes ground tiling
Changes bit mask to Haskell logo