Lightmap refactor plus lightsource refactor

Yo dawg, I heard you like refactors, so I put a refactor in your refactor so you could test refactor with refactor.

(Works but a bit of a PITA to merge)