cleanup main loop, moar renderthread stuff