context should be None by default for serializing to files.