Migrate global init stuff into UICommon.

This avoids code duplication in a bunch of places .
I also moved the NVIDIA Optimus export into VideoCommon.
Can you make them spaces? (I need to change the other cmake files over to spaces sometime)