Leader election is implemented.

Signed-off-by: Miyamoto Kazuyuki <m.kazuyuki@gmail.com>