Move initialization and closing of display to respective separate functions.
Reorder function prototypes and definitions.
Implement main game loop.