Move the code that marks strings to a function.

While doing this, notice that it used consistent_repr for positions, then repr
for the version shown to the user, and fix that.

Fixes #31