Javascript tic-tac-toe game