Outputs the graph in a machine readable JSON format.

def json_format(out, graph):
    """Outputs the graph in a machine readable JSON format."""
    steps = {}
    for step, deps in each_step(graph):
        steps[step.name] = {}
        steps[step.name]["deps"] = [dep.name for dep in deps]

    json.dump({"steps": steps}, out, indent=4)
    out.write("\n")