Port simplify.js to Python.

Because we need async calls and it's probably easiest via PyOtherSide.