Javascript tic tac toe