I started with loading the save files using an existing JS library. And then, with the help from past modders who decompiled the original Flash version, I was able to port the physics into JS. I had a lot of reference save files to verify if I did it properly.