JavaScript Tic-Tac-Toe game