Added network partition checking, and re-election in the event that the leader becomes partitioned. Also added unit tests.