Rewrite JSON dump/load to properly store the state of the workflow.