Changed fps handling.

The changes to the fps involves the part of the fps handling
that deals with "jumps" after sudden but heavy loads (like doing a very expensive
computation in one step, while not doing much in the following steps).
The previous handling worked well on certain hardware, but may have caused trouble
on other hardware, due to its sensitivity to resolution and sleeping.
The new handling should be more robust on different hardware, and may
fix some of the previous issues encountered.