Add OS.mac? and OS.linux?
Rename MacOS to OS::Mac
Move MacOS modules under OS::Mac namespace

Closes #23138.
Merge XQuartz and X11 modules
Make condition clearer using names
Extract repeated conditional to a method