Move initializing Python entity classes to before gamerules precache call, because the gamerules precache may depend on code executed in the Python initialize class methods.
Fix potential crash in ingame editor code.