serialization code for popgenIO datasets