Ticket 48770 - Improve extended op plugin handling
Bug Description: In plugin.c we had a number of in-efficenty control paths, and
loops that were repeated.
Fix Description: This reduces code duplication, and looping in un-neccesary
places.
https://fedorahosted.org/389/ticket/48770
Author: wibrown
Review: nhosoi (Thanks!)