Added config option for lighting portals

Also cleaned up some code ordering