Refactoring replset code to conform with spec
Added better tests for failover detection
fixed reporting and events for replset