Extracting discourse's text diffing functionality

That’s cool. If you do any update/fix, please consider making a PR to core as well :wink: