You could implement the 2 transformations using any language you like, and then hook into your editor of choice's on-load/on-save API, to pipe the text through the external programs.
Edit: Oops. Now I'm thinking this would probably break all code analysis features. It would be nice if there was a notion of a 'view' that is very superficial and doesn't impact the code analysis.
In Sublime Text for example, the above would be writing a Python class that handles some of these events:
https://www.sublimetext.com/docs/3/api_reference.html#sublim...
...probably by making use of the subprocess module from Python's standard library: