Started checking if the game is ended
Merge branch 'master' into endofgame
Added tests for end of game.