Improve string indexing performance.

By appending zeros lazily we could improve the indexing speed by a full order
of magnitude.