Use Seq[Parameter] and Seq[Group] rather than Set.
This change should permit the original storage order of Groups and Parameters in the C3D file to be retained.