Window closes on game end

Made the window close when the game ends. Also, improved the generate
players and decide seat functions in Table.