Currently the serialization and deserialization logic is duplicated across `Job.py` and `pyodide_work_function.py`. Find a way to make it DRY.