Finalised Encoder class.
Refactoring matchUnits service (one-step group by vs aggregation framework).