fixed issue in apply command with expected class in equal() method
Separated check patch logic from apply patch command and operation.
A new operation and a new plumbing command have been added for patch validity checking
Merge pull request #403 from volaya/apply

fixed issue in apply command with expected class in equal() method