Cleanup g_main.c and add sanity checks
Cleanup g_misc.c and add sanity checks
Cleanup g_monster.c and add sanity checks