Fix group tree

Changes how groups tree is built: if it hits an orphaned subgroup it will add the parent to the tree, even though the user is not a member of it.

Re-enable invite-to-subgroup