Add tests for usergroups feature

Sorry it took me a while.