Classic XO game on Javascript