Fixes for ss_max query

Max and Min now reuse a single MutableLiteral; CountDistinct now uses Op...enHashSet instead of Scala's collection library