ECC - complex multiplication and key agreement

I'd like to ask three questions - 2 of them regard CM method. The last is regarding the ECC domain parameters generation on the fly, see https://eprint.iacr.org/2015/647.pdf

1. What role has discriminant $$D$$? When generating new curve, what I should choose as $$D$$? I saw $$D=1$$, but other source says is should be bigger number, so I dont know...

2. The same as 1), but what is class-number explanation for dummies?

3. In the source I provided, they discuss on the fly generation of parameters. I understand that every end-point generate new elliptic curve group with CM method for just one DH key agreement, but I dont understand how this end-point can communicate with other party. If both parties want to communicate, they need to have same ell. curve group, but how they can have same group if every of them randomly generates their own group...?

Thanks for any comment. Daniel