Resource managing and stat managing

- Adding a way to unload a resource if it's unused
- calling function pause and unpause of the state
Changing game loop behavior

Now the game loop prioritise drawing and update the game logic only when
it can