Refactor Grouped to use TypedPipe

Grouped took a Pipe. This simplifies and cleans the code, and also keeps the types around longer.