[backport] SI-6482, lost bounds in extension methods.

Squashed commit of the following:

commit 5c156185306ba797c0443d9dccae0ae7ce462a1f
Author: Paul Phillips <paulp@improving.org>
Date:   Sat Oct 6 15:42:50 2012 -0700

    A little more housecleaning in ExtensionMethods.

    The only real contribution is readability.
    (cherry picked from commit 61f12faacaaccf366f9211ba6493fb042a91f1d2)

    Conflicts:
    	src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala

commit 79f443edf584745d614e24fb9ca6644c6b18d439
Author: Paul Phillips <paulp@improving.org>
Date:   Sat Oct 6 14:22:19 2012 -0700

    Incorporated pull request feedback.
    (cherry picked from commit 153ccb4757718cceb219988f30381f73362e6075)

commit 707f580b0cdcb01e27ca4c76991dea427945b5bd
Author: Paul Phillips <paulp@improving.org>
Date:   Sat Oct 6 10:20:45 2012 -0700

    Fix for SI-6482, lost bounds in extension methods.

    That was a good one. How to create a new method with type
    parameters from multiple sources, herein.
    (cherry picked from commit ff9f60f420c090b6716c927ab0359b082f2299de)

commit 8889c7a13f74bc175e48aa2209549089a974c2af
Author: Paul Phillips <paulp@improving.org>
Date:   Fri Oct 5 22:19:52 2012 -0700

    Responded to comment about how many isCoercibles there are.

    I make the case that there is only one.
    (cherry picked from commit 883f1ac88dd7cec5882d42d6b48d7f267d1f6e00)
SI-7022 Additional test case for value class w. bounds

As reported against 2.10.0, and as fixed by SI-6482,
which was backported in the previous commit.
replace symbols correctly when subtyping dependent types

as discussed in [1], this change has no impact on the scala type
system, but it can fix subtyping for annotation checkers if the
pluggable type system supports annotations that can refer to method
parameters.

[1] https://groups.google.com/forum/#!topic/scala-internals/kSJLzYkmif0/discussion
case module toString is synthetic
Allow for Function treess with refined types in UnCurry.

Also removes an unnecessary condition in UnCurry, isFunctionType(fun.tpe)
is always true.
Keep annotations when computing lubs

Integrates annotationsLub into lub.

Also fixes SubstSymMap when mapping over annotaion trees. I don't
understand what the previous code was supposed to achieve, but it
crashed in some of my examples.
SI-1803, plus documentation and cleanups in Namers, mainly in typeSig

- when typing (and naming) a ValDef, tpt and rhs are now type checked
in the same context (the inner / ValDef context). this does not change
any behavior, but is more uniform (same as for DefDef). martin told me
(offline) that this change is desirable if it doesn't break anything.
(it doesn't).

- typeSig is now more uniform with a separate method for each case
(methodSig, valDefSig, etc). methodSig was cleaned up (no more variables)
and documented. the type returned by methodSig no longer contains /
refers to type skolems, but to the actual type parameters (so we don't
need to replace the skolems lateron).

- documentation on constructor contexts, type skolems

- more tests for SI-5543
Analyzer Plugins

AnnotationCheckers are insufficient because they live outside the
compiler cake and it's not possible to pass a Typer into an annotation
checker.

Analyzer plugins hook into important places of the compiler:

  - when the namer assigns a type to a symbol (plus a special hook for
    accessors)
  - before typing a tree, to modify the expected type
  - after typing a tree, to modify the type assigned to the tree

Analyzer plugins and annotation checker can be activated only during
selected phases of the compiler.

Refactored the CPS plugin to use an analyzer plugin (since
adaptToAnnotations is now part of analyzer plugins, no longer
annotation checkers).
Fix context for type checking early initializers

Before:

scala> class A { class C extends { val x: A = this } with AnyRef }
<console>:7: error: type mismatch;
 found   : A.this.C
 required: A
       class A { class C extends { val x: A = this } with AnyRef }
                                              ^

Note that the same thing is necessary and already done in Namers (see
def createNamer). The whole logic of when and how to create contexts
should be factored out and reused in Namer and Typer.

(
My Hobby [1]: detecting compiler by just looking at its soruce
[1] http://www.explainxkcd.com/wiki/index.php?title=Category:My_Hobby
)
Merge pull request #1976 from retronym/backport/1468

[backport] SI-6428 / SI-7022 Value class with bounds
Merge pull request #2022 from lrytz/analyzerPlugins210

Analyzer Plugins