Added support for multiple parent resource groups

I added support for parent resources that are in multiple resource groups. There is also a bit of extra logic to make sure we only attempt to join the resource to groups it already belongs to.