Tic Tac Toe in Javascript