Leverage js.UndefOr[A] to type more precisely some of our APIs.

In particular, js.RegExp.ExecResult is now a subclass of
js.Array[js.UndefOr[String]].

In the process, this also uncovered a bug in java.util.regex.Matcher
which had to be fixed at the same time to still typecheck.