New Structure

Most notably, changed the game loop to be a recursive function rather
than an infinite while loop. In addition, changed error handling
conditions and made other minor changes.