Fix group resolution: when groups are resolved, remove them.

resolveForwardDeclarations() is called multiple times.
The group implementation commit actually fixed an old bug with ordering.

When sequence or choice was used, the serialized elements were in the wrong order.
Add QDebug operators for Element and Group.