Pull out common base class for formatting unit tests, removing duplicate code that accumulated over the years. Pull out macro expansion test into its own test file.