Correct implementation of ToInteger.

We split the implementation around the limit test in order to cleanly
handle numbers near 2^32.
Use String#substr for result instead of creating new strings from scratch.

This allows implementations to reuse the backing storage for the string
under the hood.
Use String#slice instead of String#substr.

String#substr is only defined in the ES3 "Compatibility Annex B".