TicTacToe game in JavaScript