Reorganized lightfx.cc for better maintainability.