Move some variables to CONFIG structure
Move load/save config to separate functions
Fix the use of MAX*** defines
Fix use of MAXSPELL and convert some do {} while(1); loops to for(;;){} ones
Unite duplicate code
Change keys layout for gcw0
Don't crash on empty savestate load
Don't save void savestate