Constant-fold Matches.
Fix {ir,js}.Block.toString().
More constant folding with operands disappearing.

Their side-effects must be preserved.
Insane rewritings of expressions involving Longs.

To remove as many Long operations as possible, and in particular
turn them into Int operations where applicable.

These insane rewritings are motivated by the shapes of expressions
we get if we inline Ranges (which is not yet done).
Add Range to overrides for tracking changes.
Backport https://github.com/scala/scala/commit/7abb0c911a7c3d60057fbcab6fc3687322a67082 to 2.10.
Mark Range and Range.Inclusive as inlineable classes.

This removes *all* the overhead if all 3 parameters of the
range are constants. For example,

  for (i <- 0 until 10 by 2) { ... }

If the step is either 1 or -1, and either start or end is
constant (very common case), then almost all the overhead is
removed, and in particular there is no Long operation anymore.
For example:

  for (i <- 0 until n) { ... }

If the step is constant > 1, start is 0, and the range is not
inclusive, then all Long operations also disappear.
For example:

  for (i <- 0 until n by 2) { ... }

The private method `fail()` was moved to an implementation in
the companion object of Range, so that it is not inlined along
with the useful parts of the Range.
Merge pull request #1145 from sjrd/inline-away-for-range

Fix #1144: Inline away for-ranges
Fix #1162: Implement java.lang.Arrays.equals
Fix #1017: Fast MethodDef comparison through hashes

By hashing the method defs the compiler emits, we can calculate more
accurate diffs in the incremental optimizer. This allows us to truly
only re-optimize methods that have changed (and their dependees).

Pseudo-benchmarks have shown that the speed-loss is acceptable:
~7% additional compile time for the whole scalajs library.

The changes to MethodDef made the pattern matcher (or typer) choke,
hence the seemingly unrelated changes to the patterns.
Merge pull request #1105 from gzm0/hash-methods

Fix #1017: Fast MethodDef comparison through hashes
Fix #1163: Remove packager and non-direct full optimizer
Merge pull request #1165 from gzm0/remove-packager

Remove packager
Fix #1154: Add @JSExportDescendentClasses (exports subclass ctors)
Merge pull request #1168 from gzm0/export-all-ctors

Fix #1154: Add @JSExportDescendentClasses (exports subclass ctors)
Get rid of redundant operators in the IR.

-x     ->  0 - x     (Int, Long, Double)
~x     ->  -1 ^ x    (Int, Long)
x ^ y  ->  x !== y   (Boolean)

This simplifies the optimizer quite a bit, because less cases
have to be taken into account, the old cases for unary operators
falling into the generalized cases of the binary operators.

Some optimizations applicable to unary operators were not already
supported by the translation, in which case I added them. In the
process, I reproduced similar optimizations on other operators.
For example, to replace the old `~(~x)` becomes `x`, I added the
case `(x ^ (y ^ z))` with literal `x` and `y` folds into
`((x ^ y) ^ z)`, where (x ^ y) is a single literal. This prompted
to implement the equivalent optimization for & and | too.
Turn ClassOf(cls) into a Literal.

Most of the changes are just about moving the `case ClassOf(_)`
to its new rightful place, near the other Literals. The other
changes are removal of the ClassOf case altogether, where the
generic Literal case already does the right thing.
Remove DynType, and replace it by AnyType everywhere.

The JS operations, which were previously only allowed on
operands of type DynType, are now allowed on any operand.

Casts to DynType are obviously removed.

The rationale for this change is that casts to DynType were
always allowed, meaning that AnyType and DynType could contain
exactly the same set of values. The distinction was introduced
at some point to verify that we only used JS operations on
values explicitly asInstanceOf'ed to raw JS types, but now it
only complicated things.
Use less mutable vars and less casts in GenJSExports.
Remove Cast from the IR altogether.

The last few remaining casts generated by the codegen were
converted into proper asInstanceOf's.

There is one remaining hack for RuntimeString, because
j.l.Strings are given to the $this param of RuntimeString
methods, which expect a sjsr.RuntimeString. To address this
without casts, I modified the IR subtyping test so that
j.l.String <: sjsr.RuntimeString. This is a hack, but it is
already less hacky than the cast. Hopefully we'll be able
to get entirely rid of this with proper static methods in the
future.