Functional magic-write for our code

I change the magic-write so now this can be translated the world into string and translated back. But I am still working on the save and load function. Check this one as well to see if any change is needed.