Remove demo mode
Only perform update & render when the window is focused.

It looks like vsync is disabled when the window is not visible, so the application consumes a lot of time when you switch to another one.
An ideal solution would involve rendering if the window is visible on-screen, but there is no way to get this information from glfw.
Let’s disable rendering/update completely in inactive state for now.