Writes model under its key: the frames first, model.json last, so a folder with a model.json is always complete. Replaces a model of the same key, then removes frames left over from it. Each file write goes through writer.
model.json