I see no reason to let the choice between a greedy and a lighter loading method, so better remove it to simplify the code.
Move grid management functions out of polygons.lua, in a new file called gridmanager.lua Explicitly call other files and grid management functions from init.lua to make workflow more apparent Move mapgen loop out of init.lua, into mapgen.lua