Fix lighting and buffer issues after setDirty().

A partial rewrite of the lighting algorithm.

Now uses a unpropagate routine after a setDirty() instead of a full
rework.