fixed type errors in AggregateMode

Which is now completely typesafe, at the cost of having to use parameterless case classes in the place of case objects