[NFC intended] Refactor the code for printChanged for reuse and to facilitate subsequent reporters of changes to the IR in the new pass manager. Create abstract template base classes for common functionality and give classes more appropriate names. The base classes handle all of the determination of when a function or pass is "interesting" and should be reported or filtered out. They have pure virtual functions which are called when a change by a pass has been recognized so the derived class need only provide the overrides to present the information about the changing IR. There are at least 2 more change reporters to come (which were presented in my tutorial at the 2020 llvm developer's meeting) that derive from these classes.
Respond to review comments: move function out of line, remove inline keyword,
remove unneeded qualifiers, simplify comparison.