Use text/scanner.

When I asked why this branch wasn't merged into master yet, you said the most likely reason was that you simply forgot about it.

So I'm making this PR for your convenience as a reminder. As far as I can tell, this approach should be better.