Fix IR type (missing asInstanceOf) for fromAny() of value class.

Discovered through run/t8017

If a value class' content is a generic type, its unbox method
returns Object (or the upper bound of the type parameter) rather
than the actual type. So the result itself must be further
asInstanceOf'ed.
Fix #573: Add an IR checker.

The IR checker can be enabled with the setting
  checkScalaJSIR := true
It will perform a complete sanity check of the IR and typecheck it
during fast-optimizations.

Note that it will not even run if fast-opt reports at least one
"linking" error.

The IR checker is disabled by default in the sbt plugin, but we
enable it for all the examples and the test suite in the Scala.js
build. It is also enabled for the partest suite.
Merge pull request #646 from sjrd/ir-checker

Fix #573: Add an IR checker.