Moved all the mapgen code out of game.py and into mapgen.py

Needs a little bit of testing just to make sure I didn't miss anything, but it should work.