adding a quick and untested gc-state refactoring script. Using this without some manual code modification in GC_init and GC_copy will cause errors