Merge pull request #39 from m1ch1/master

FileUtils: Auto-close streams.
Leader election implementation.
Merge pull request #17 from EasonLiao/election

Implement leader election