refactored legion opt functions to be more plugin friendly
Merge pull request #207 from prymitive/legion_api

refactored legion opt functions to be more plugin friendly