Split up mapgen.cpp