Membership ephemeral entry and initial leader election

Also:
- env.sh to load what's needed for dev
- refactored main
- async consul client instead of blocking
10 files changed