major refactoring of world_gen.cpp and world_gen.h