Factor out a standalone EventPump for use in tests etc.
Have masterelection_test wait on the leadership.
Merge pull request #343 from AlCutter/event_pump

Factor out a standalone EventPump for use in tests etc.
Put more "using" statements in etcd.cc.

Also use the std::chrono::seconds typedef in the header.
Delay before retrying.

This fixes #329.