Javascript based Tic Tac Toe