The `compile_input` function has managed to remain pretty clean since it was created, perhaps the json emission would be better suited inside of the phases themselves?