SI-8133 Fix regression with package objects, overloading

Regressed in f5c336d56, a refactoring of `typedIdent`. In that
commit, an (ostensibly) accidental change arrived, equivalent to:

    - val pre1  = if (qual == EmptyTree) NoPrefix else if (sym.isTopLevel) sym.owner.thisType else qual.tpe
    + val pre1  = if (sym.isTopLevel) sym.owner.thisType else if (qual == EmptyTree) NoPrefix else qual.tpe

Here, `qual` is a tree returned in the successful result of
`Context#lookup`.

This change itself looks innocuous (top level symbols can be prefixed
with a qualifier or not, right?), but it exposed us to a bug in
`makeAccessible`. It is responsible for rewriting, e.g,
`scala.List` to `scala.package.List`. It has a few cases, but one
of them relies relies on typechecking `Ident(nme.PACKAGE)`, and
hoping that it will bind to the right place. That's fraught with
danger, and breaks in the enclosed tests.

This commit binds that Ident symbolically, and in the process
factors a tiny bit of code in common with `TreeGen`. (More work
is still needed here!)

In the next commit, I'm going to revert the change to `pre1`. That
would have also fixed the regression, albeit symptomatically.
SI-8151 Remove -Yself-in-annots and associated implementation

This experimental option typechecked arguments of annotations
with an injected value in scope named `self`:

    @Foo(self.foo < 1)

This has been slated for removal [1] for some time.

This commit removes it in one fell swoop, without any attempt
at source compatibility with code that constructs or pattern
matches on AnnotatedType.

[1] https://groups.google.com/d/msg/scala-internals/VdZ5UJwQFGI/C6tZ493Yxx4J
SI-6844 restrict splicing in parameter position

Previously were a bit too permissive on how splicing in function
parameter position worked. This made confusing things like
possible:

   val x = TermName(“x”)
   q”def foo($x)”

Now you can either splice trees in that position (ValDefs) or
you have to provide type if you splice a name.
SI-8076 improve support for implicit argument list

This adds support for construction and deconstruction
of implicit argument list which was originally suggested
by @cvogt.

1. Splicing vale into implicit argument list automatically
   adds implicit flag to them:

     val x = q"val x: Int"
     q"def foo(implicit $x)"
     // <=> q"def foo(implicit x: Int)"

2. One might extract implicit argument list separately from
   other argument lists:

     val q”def foo(...$argss)(implicit ..$impl)" =
       q"def foo(implicit x: Int)
     // argss is Nil, impl contains valdef for x

   But this doesn't require you to always extract it separatly:

     val q”def foo(...$argss)" =
       q"def foo(implicit x: Int)
     // argss contains valdef for x
Improve naming of ReadStdin

We don't need to say everything twice, methods are already prefixed
with “read”.
quasiquotes no longer evaluate debug logs when debug logging is off
fixes a typo in Types.scala
SI-8158 compiler hangs printing out fancy types

Apparently, even though the compiler has safeguards against infinite type
printouts, having a depth counter, we didn’t account for the cases when
printouts are both self-referential and self-multiplying.

For one, SI-8158 provides an example of such a type, which is a structural
type that refers to itself twice in return types of its methods. At first,
printing such a type would go deeper and deeper, but then it will hit
the depth limit and start multiply indefinitely.

This commit fixes this particular problem by recognizing self-references
as this.type’s and printing them out as such. The subsequent commit will
introduce a more general facility.
introduces failsafe against endless type printing

The parent commit works around a particular problem that led to a compiler
freeze in SI-8158, whereas this commit introduces a general solution -
a cache that tracks all types that we've recursed into during printing.

I can't immediately come up with an example of a type that would be caught
by this safety net, but unknown unknowns are the worst of them all, so why not
guard against them while we can.
capitalizes “s” in tostring

As suggested by the reviewers, tostringXXX variables in TypeToStrings.scala
have been renamed to toStringXXX.
addresses pull request feedback
temporarily disables the toStringSubjects cache
SI-7445 ListMap.tail is returning wrong result

Reverted the commit that introduced the bug, and modified HashMap to no
longer assume that tail is O(1).

Review by @Ichoran, @soc
Merge pull request #3385 from xeno-by/ticket/8158

fixes some typos and types
Merge pull request #3365 from retronym/ticket/8133

 Fix regression with package objects, overloading
Merge pull request #3368 from retronym/ticket/8151

SI-8151 Remove -Yself-in-annots and associated implementation
moves analyzer.ImportType into scala.reflect.internal

This cute little type is necessary for importers to work correctly.
I wonder how we could overlook its existence for almost 2 years.
deprecates resetAllAttrs and resetLocalAttrs in favor of the new API

We now have c.untypecheck, which is supposed to be a counterpart of c.typecheck
in the sense that it goes back from typed trees to untyped ones:
http://stackoverflow.com/questions/20936509/scala-macros-what-is-the-difference-between-typed-aka-typechecked-an-untyped.

Let’s hope that c.untypecheck will soon be able to solve our problems
with partially/incorrectly attributed trees emitted by macros:
https://groups.google.com/forum/#!topic/scala-internals/TtCTPlj_qcQ.
Add support for Java 8 in our build.

We explicitly check for supported Java versions in our build.
Add Java 8 to the list of supported versions.
Merge pull request #3392 from xeno-by/topic/untypecheck

deprecates resetAllAttrs and resetLocalAttrs in favor of the new API