Clone str so its mutable for sub!.
Remove cruft.
Provide examples for tests and humans.
Check for unexpected types.