cpp: implement the new file name method in class header formatter

- refactor file name generation in identifier name builder;
- make use of identifier name builder in formatter.
diagrams: add a base interface for formatters

- minor tidy-ups in diagram