Fix crash medPluginGenerator

Removed anyoption.* files, and replaced with simpler logic, they had some memory allocation problems and were overkill anyway.