Search function correctly implemented

Split up Mesi state transition function into remote and local
Fixed exit kind of error
Validation through test cases on going