Moved logic for sampling the lighting environment into its own class that manages thread safe cached data structures.