misc cleanup + add runtime toggling of vsync and double buffering