Break out the lightmap code into its own class.