Add a model for group membership

We keep a separate record outside the stream for group membership,
which makes testing for membership significantly easier.