experimental macro support

I'd be very defensive here and wrap this in a `try-finally`, to make sure the document is saved no matter what happens in `removeMacroExpansions` ;-)