Ultimate Tic Tac Toe in JavaScript