support matchclass condition
refactor out commong logic between agent and plugin
Merge pull request #244 from marsqing/master

refactor out commong logic between agent and plugin