MapGen features. Worked on Cartouche Gen. Some code cleanup.