A mod is like this:
{"min-version":0,"max-version":0,"name":"example mod"}
alert('Example Mod')
The min and max version fields both have a number, which is currently 0 for 23w24a. The name field is just a name. After a single line of json, there is python code that is run.
Mods save and are run when a save is loaded.
alt+M to add a mod, alt+L to list mods, alt+R to remove a mod
The code for the game is here.