rules: add DistinctToGroupBy and EmptyGroupByToDistinct

As @7andrew7 points out, this will enable the distributed groupby logic to
push Distinct around.
ProjectToDistinctColumnSelect

move to rules, cleanup
myrialang: use Distinct->GroupBy->Distinct

and fixup tests
ShuffleBeforeDistinct: remove rule from myrialang

It is no longer possible to trigger.
Merge branch 'master' into decompose-distinct
make UDA emit clause optional
Test of uda without emit clause
introduce state for decomposable aggregates
Introduce a rule for compiling distributed UDAs
Test that optimization doesn't corrupt non-deomposable UDAs
Move plan creation to a helper function
Test of optimized, decomposable UDA
comment for decomposable uda state
Add some checking to the physical plan for decomposable UDAs
move statevar to its own module
style fix
Add type checking for state vars
affect join type through kwargs in opt_rules
test symmetric hash join
shuffle join test