added buttons to join and leave groups. I'm not happy about the duplication in JS, but it works...