Tic tac toe game written in Javascript