Groups and organisational units

This builds on the events PR and adds groups and (the beginning of) organisational units.
I'm submitting this now before this gets out of hand.