Cleanup g_newai.c and add sanity checks
Cleanup g_newdm.c and add sanity checks.
Cleanup g_newfnc.c and add santiy checks
Cleanup g_newtarg.c and add sanity checks
Cleanup g_newtrig.c and add sanity checks
Cleanup gnewweap.c and add sanity checks