Rewriting the previous tictactoe game using Javascript and jQuery