Reorganized JSON/graph reading/writing functionality into a utility file.