Made the game automatically restart after a certain number of generations, or
when a stable pattern is reached. Tidied up code.