Add Cast() case in OptimizerCore.pretransformExpr().

This is necessary for a Cast(expr) not to force expr if the
result of the Cast is not used.
Fix js.ArrayOps.repr.

Its default implementation is to return
  this.asInstanceOf[Repr]
but we have to override it to return `array`.
Fix #1084: Optimize js.Array and js.ArrayOps.

First, methods of js.Array that have the same name as methods
in the Scala collection library have been renamed or moved
to a separate, discouraged implicit pimp js.JSArrayOps.

Second, js.ArrayOps, its builder and CanBuildFrom have been
made extensively inlineable.

Finally, faster versions of some methods are included.

This achieves two things:
* Usage of js.Array can be done just like any other collection,
  without surprise of different behaviors.
* Methods of js.Array (particularly higher-order ones) can be
  optimized much more aggressively.