Leader election implementation.
Merge pull request #17 from EasonLiao/election

Implement leader election