Speed up substring handling

We compute the length here, so we update the length computation to also
store whether a string is ascii only.

In the substring handling, we also check if the string is ascii only and
use the shortcut path there to use a byte based substring for ascii only
strings.