Split apart the update, render, and even processing into separate functions.
Change the main loop to use be fixed update interval, variable render interval.