Other internal state should stay in python only for a few of reasons. 1. It avoids having the serialize via json when calling the JS compiler. 2. It avoids external JS libraries accidentally depending on this internal state.