Add group manager concept - need review

I'm really not comfortable with some of the code in here, but I think I'm on the right track - looking for some review as I am starting to get lost in the code..., happy to rework any/everything.

basically, have added an optional type parameter through the named groups code, tests are nearly all passing although I couldn't get mongo ones running. Really not sure if I am on the right path here or if I should consider creating a "acts as typed named group" or similar - feels a bit clunky