video code cleanup, resolution detection for video menu, refresh rate cvar and general cleanups