Rework XF register loading a bit and change how registers are arranged in memory. This removes the assumption that all data for a viewport or projection matrix will be available when index 0 is loaded. Fixes issue 3688 and probably breaks old save states (sorry).
The compiler need not obey the static keyword, so to avoid linker
problems, whole functions in .h files need to also be static in
case they are included in several .cpp files.
Also a few other minor LTO fixes.