Particle compositions are exported from the GUI to the script in the wrong order

Example: composition of composition of single particle.

The resulting script calls particle_3 before it is defined.

    # Define particles
    particle_1 = ba.Particle(material_Particle, ff)

    # Define composition of particles at specific positions
    particle_2 = ba.Compound()
    particle_2.addComponent(particle_3)
    particle_2.addComponent(particle_1)
    particle_3 = ba.Compound()