Removing thousands of group folders from Contacts
I suppose that depends on how many you want to keep...

Let me esplain... It might be easiest to select the entries you want to keep. Hold Command and click, in turn, on each entry needed to be kept. then drag them to the desktop. You have now saved a backup.

Select everything in the address book and delete everything. Once that is done and it has synced across devices, drag the backed up contacts back into address book.

No it is not automated and depending on how many entries you want to keep it may still be a bit on the labor intensive side but it has the benefit of being simple...