Sorting properties, both in drop down and in the list of related properties.

Issue: GCP-9122
Reviewer: Rebecca (post commit)
Fixing a bug where the same variable could be selected twice if you move between related groups in between selecting.

Issue: GCP-9122
Reviewer: Rebecca (post commit)