added join group protocol, fixed heartbeats, improved leader/leader election