Make congruence classes immutable and add draft of compression algorithm