Add support for groups. closes #2