Adding OutputFormatter base class

Did you simplify this code? The `// Performance-sensitive` comment is like the ones that Anthony used to leave where he did work... so seeing that comment + a capturing lambda is... :laughing: 

Maybe just remove the comment if that's the case. If there's a hotspot here we'll find it again and maybe adopt a different fix.