SI-5235 Correct usecase variable expansion

The bug is related to a couple of other annoyances, also fixed:
 - usecases without type params were crashing scaladoc due to a change
in the PolyTypes class (not allowing empty tparams list)
 - properly getting rid of backticks (even if the link is not valid)
 - correct linking for usecases with $Coll = `immutable.Seq`
(the symbol searching algorithm was too of restrictive, now we search
the entire ownerchain - and the empty package at the end)
 - give a warning if the type lookup fails
 - finally, added a $Coll variable to List, for some reason it wasn't
there and we were getting immutable.Seq as the result of use cases.
SI-3314 SI-4888 Scaladoc: Relative type prefixes

And adds support for linking to class members, only usable from the
model factory now, so no links to members from the doc comment yet,
sorry. But it fixes the Enumeration problem once and for all!

Also corrected the inTpl for members obtained by implicit conversions,
so they're in the correct template and the comment variable expansion
is done from the correct (but different) template.

Review by @kzys.
Scaladoc: Inherited templates in diagrams

Related to SI-3314, where we started showing inherited templates
that were normally not documented. This patch corrects a problem
in parentTypes that was preventing inherited templates from being
displayed in diagrams.

Also renamed:
PackageDiagram => ContentDiagram
ClassDiagram => InheritanceDiagram
which should have been done much earlier
SI-5965 Scaladoc crash

This bug was fixed by the model upgrade in c11427c1. Test case confirmation.
SI-5558 Package object members indexing

This bug was fixed by the model upgrade in c11427c1. Test case confirmation.
SI-4324 Scaladoc case class argument currying

case class C(i: Int)(b: Boolean) would appear uncurried in scaladoc:
case class C(i: Int, b: Boolean)
Scaladoc: workaround for untypical Map usecases

SI-3448 partial fix:

This enables a workaround for the fact that Map takes two type params
while $Coll takes only one. But it doesn't fix the problem though,
as there's one more piece missing from the puzzle - we need to adjust
the `Coll`s in {immutable, mutable, concurrent}.Map to something that
makes sense for the usecase. And that's not possible. But I'm
committing this nevertheless, maybe other projects can benefit from it.

And for SI-3448, the solution lies in automatic usecase generation,
whenever that will be ready.
SI-4360 Adds prefixes to scaladoc

This was a long-standing issue in scaladoc: It was unable to
disambiguate between entries with the same name. One example is:
immutable.Seq:

trait Seq[+A] extends Iterable[A] with Seq[A] ...

What's that? Seq extends Seq? No, immutable.Seq extends collection.Seq,
but scaladoc was unable to show that. Now it does, depending on the
template you're in. Prefixes are relative and can go back:
-scala.collection.Seq has subclasses *immutable.Seq* and *mutable.Seq*
-scala.immutable.Seq extends *collection.Seq*

Unfortunately the price we pay for this is high, a 20% slowdown in
scaladoc. This is why there is a new flag called -no-prefixes that
disables the prefixes in front of types.

Btw, it also fixes the notorious "booleanValue: This member is added by
an implicit conversion from Boolean to Boolean ...". That's now
java.lang.Boolean, so it becomes clear.

Conflicts:

	src/compiler/scala/tools/nsc/doc/model/diagram/DiagramFactory.scala
Scaladoc minor fix: Typos in diagrams

As suggested by Heather in pull request #816.
SI-4887 Link existentials in scaladoc

Based on an inital patch by Nada Amin. Rewrote some of the code to
compress it a bit.

Also fixed a problem that was affecting the prefix printing for
typerefs: type parameter and existentials won't get prefixes. While
I can imagine cases where you'd want to see where they come from,
you can always hover over them and see their origin.

Also added support for pretty-printing ThisTypes, SuperTypes and
SingleTypes (with links)
SI-3695 SI-4224 SI-4497 SI-5079 scaladoc links

Adds the ability to link to members, classes and objects in scaladoc.
The links can now be either qualified names or relative names, they
both work. See the test/scaladoc/resources/links.scala for a usage
example. Also introduced -no-link-warnings scaladoc flag, in case the
build output gets swamped with link warnings.
Scaladoc: Reducing the memory footprint

 - diagrams are not stored because they create many TypeEntities, nodes
and edges -- now they are created on demand, so make sure you don't
demand them twice!
 - eliminated the type entity cache, which was nearly useless (6s gain)
but was preventing the GC from eliminating TypeEntities
 - an unsuccessful attempt at reducing the tons of :: garbage we're
generating - there's 200MB-250MB of ::s during a typical 'ant docs.lib'
Scaladoc: Reducing the memory footprint 2

 - got rid of references to WikiParser when creating EntityLinks
Scaladoc: updated type class descriptions

The known type class descriptions give you a humanly-understandable
explanation for [T: TypeClass] in the implicit conversions. For
example [T: Integral] will tell you that T must be an integral type
such as Integer and co.

Now that the reflection dust settled, I can actually add the test to
make sure the well-known type classes are intercepted and explanations
are given instead of the usual "the type T is context-bounded by
TypeClass"
SI-5533 Skip scaladoc packages from documentation
Scaladoc: Refactoring the entities

for SI-5784. This commit has been checked with tools/scaladoc-compare
and the only difference is that the containing entities in the index
are not duplicate anymore, which solves yet another bug we did not
know about. :)
SI-5784 Scaladoc: {Abstract,Alias} type templates

Normally scaladoc won't generate template pages for anything other than
packages, classes, traits and objects. But using the @template
annotation on {abstract,alias} types, they get their own page and take
part as full members in the diagrams. Furthermore, when looking for the
companion object, if a value of type T is in scope, T will be taken as
the companion object (even though it might be a class)

All templates, including types are listed on the left navigation pane,
so now adding @template to String can get scaladoc to generate (a
no-comments) page for java.lang.String.

The {abstract, alias} type icons need to be updated -- I just took the
class icons and added a small x to them -- but they shoud be something
else (maybe an underscore?)i

TO USE THIS PATCH:
<pre>
/** @contentDiagram */ // tells scaladoc to create a diagram of the
                       // templates contained in trait Base
trait Base {
  /** @template */ // tells scaladoc to create a page for Foo
  type T < Foo
  trait Foo { def foo: Int }
}

/** @contentDiagram */
trait Api extends Base {
  /** @template */
  override type T <: FooApi
  trait FooApi extends Foo { def bar: String }
}
</pre>
Scaladoc: Typers change

as requested by @adriaanm on pull request #925
Scaladoc: Groups

Group class members based on their semantic relationship. To do this:
 - @group on members, only need to do it for the non-overridden members
 - -groups flag passes to scaladoc, groups="on" in ant
 - @groupdesc Group Group Description to add descriptions
 - @groupname Group New name for group
 - @groupprio Group <int> (lower is better)
See test/scaladoc/run/groups.scala for a top-to-bottom example
SI-5784 Scaladoc: Type templates

@template and @documentable are now synomims.