Fix for type applications.

Test case in TreeTransformers.scala. We have there

    type Mutator[T] = (TreeTransform, T, Context) => TreeTransform

It turns out that then Mutator[X] for some type X did not typecheck because
the typer got confused what were the type parameters of the Function3 type on
Mutator's RHS. The fix adds a case to handle RefinedTypes that bind type
parameters.
Making dotc/transform Dotty compliant

Fixes to make the files in `transform` compile in Dotty.
Handling of higher-kinded types in intersections and unions.

If we intersect a higher-kinded type C with an instance C[T],
we should expect C[T].

Conversely, taking the union of a higher-kinded type C and an
instance C[T] should give C.

Previously, the higher-kinded place-holder $hkN was merged with
&/| with the type T which led to type errors.
Tightening of rules for explicit types for implicit defs

1) We now demand that all implicit defs have an implicit type, not
just class members. If we admitted implicit term members without
explicit types, the rules and algorithms for dteremining eligible
implicits would be greatly complicated (because there's always the
danger that inferring the type by typechecking the rhs causes a cyclic
reference).

2) We check for violations of this rule earlier, during type completion, in order
to avoid cyclic references happening before we do the check.
Added compliing dotc/transform to tests

With the previous fixes, we can now compile dotc/transform without errors.