Added support for groups, closes #7