Refactor: split checking of formatting & 'in-place' formatting

This simplifies the python script quite a bit by doing all the in-place
formatting done by the 'format' CMake target in one path, and the
checking of correct formatting in another.

formatFile() is now only used to change (format) a file via the 'format'
CMake target.

requiresFormat() is now only used by the correctness checking logic, and
does the clang-format and the diff in one function.