Chandy-Misra-Haas update with tests, no RPC yet
Chandy-Misra-Haas update with tests, no RPC yet, some code reformatting (spaces, indents)