[Core] Change and simplify RenderLoop implementation to allow custom loop.