Bullet-proofing companion objects

Companion class/module computations now also work for local classes and modules. For this to work,
either one of two conditions must be met: (1) some enclosing context refers to a scope that
contains the companions. (2) the context's compilation unit has a typed tree that contains the
companions. (1) is usually true when type-checking, (2) when transforming trees.

Local companions are searched as follows: If (2) holds, we locate the statement sequence containing
the companions by searching down from the root stored in the compilation unit. Otherwise, we search
outwards in the enclosing contexts for a scope containing the
companions.
Fixed parse error with @unchecked

Dotty currently cannot parse @unchecked annotations in pattern types. That's why the previous commit failed. We need to come back to this and fix it. For the moment, to make on the current branch, the annotation is removed.
Merge pull request #69 from odersky/topic/generalize-companions

Bullet-proofing companion objects
Test case for TreeInfo#defPath

I'm about to refactor that method in terms of a TreeAccumulator.

Note that I've packaged the test case in `dotty.tools.dotc.ast`
 I believe this is the best approach for organizing unit tests:
 the import tax is minimized, and use of relative imports is
 made less fragile by avoiding creating new packages to test code.

I'll reorganize the other unit tests like this if others agree.
Refactor TreeInfo#defPath

Uses a TreeAccumulator, rather than ad-hoc descent through `productIterator`.
Merge pull request #76 from retronym/topic/defPath-accum

Test and refactor TreeInfo#defPath
Remove dependency on scala-xml.

Mimic https://github.com/scala/scala/commit/4e9b33ab24bb3bf922c37a05a79af364b7b32b84
Reorg of info transformer framework
Renamings TreeTransformer -> TreeMap, TreeMapper -> TreeTypeMap

This makes naming uniform between trees and types, and also avoids the clash with
transform.TreeTransformer. The idea is that transformers are parts of phases, and
have logic that is phase-specific. In particular, a context is passed around when
transforming a tree. Maps are simpler, they only have a T -> T apply method.
Renaming core.Transformer(s) -> core.DenotTransformer(s)

To bring in line with TreeTransformer terminology.
Refactored denotation transformers

Many small and large changes. Added samplePhase to demonstrate functionality.

To test functioning, run the compiler with args

     tests/pos/uncurry.scala -Ylog:sample,terminal
Re-enabled and renamed tests

CreateCompanionObjectTests were re-enabled. They failed in a previous version but succeed again in the latest commit.
Also uncurry.scala got renamed to curried.scala.
Merge pull request #79 from DarkDimius/noxml

Remove dependency on scala-xml.
LazyVals phase.

Creates accessors for lazy vals:
1) lazy local vals are rewritten to dotty.runtime.Lazy*** holders
2) for a non-volatile field lazy val create a non-thread-safe accessor and flag:
2.a) if lazy val type indicates that val is not nullable, uses null value as a flag
2.b) else uses boolean flag for sake of performance, method size, and
allowing more jvm optimizations
3) for a volatile field lazy val use double locking scheme, that guaranties no
spurious deadlocks, using long bits as bitmaps and creating companion
objects to store offsets needed for unsafe methods.

Conflicts:
	test/dotc/tests.scala
Allow MiniPhase to be DenotTransformer

All MiniPhases now as are full-fledged phases,
and are given their own periods and can register DenotTransformers.
MiniPhases belonging to same group(list) will be squashed to single phase.
apply srewrite (explicit types for implicits + no procedure syntax

for constructors) to tests/untried/pos
apply srewrite (no procedure syntax for constructors) to tests/untried/neg
move all tests in tests/untried/neg which use implicits to tests/untried/neg-with-implicits
Merge pull request #84 from samuelgruetter/srewrite-tests-1

Explicit types for implicits in tests/untried
Merge pull request #81 from DarkDimius/integration/lazy

 Allow MiniPhase to be DenotTransformer & LazyVals