photon sort by layer

-press , and . to change treshold layer, photons above it are discarded.
-some output/input optimisation
-press r to refresh