Updated Group handling - backported code from FirefoxOS version
Merged from upstream