correctly parse all integer types. fixes #9289

Used `parseint` and `parsefloat` methods instead of `float64_isvalid`.

The last `try`...`end` does not have a catch.  Is there a reason to use `try`...`end` for that case instead of just `val = parseint(BigInt, sval)`?

P.S. I vaguely recall something like this showing up in a C++ benchmark, which caused compiler implementers to come up with crazy optimizations for this kind of practice, even though the practice was nominally discouraged.