This is another step to allow reconnecting after connection loss or
browser closing.
When the game is left with the X button on the bottom right, we will
close the websocket connection, to let the server know, that we are
gone.
The server still has issues that prevent this from working flawlessly.
Remove unused import
In window widths or heigths that are not divisible by 8, the chess board
would contain lines between the squares (since the contraints of the
chess board rows would contain non-integer constraints).
With this commit, we calculate margins manually, in order to constrict
the chess board to widths and heights that are divisible by 8.
1. Fix the bug that made black move first in a new game when the old
game was ended during blacks turn.
2. Fix bug that offered the promotion dialog to the player when a pawn
was moved on the last rank from any square
Also, a late initializer error was fixed because the wrong move variable
was used when a pawn reached the last rank.