Reorganised game code, changed timing stuff.

The section of code handling the game before the user starts it has been
separated from the main loop now to make things a bit easier to read. I've
also modified the way the game is timed so that it now waits the correct
amount of time before the next turn, taking into account the time spent in the
loop processing input and drawing to the screen.

However, there is still work to do on this to make sure it behaves as required.