Added AJAX function for playing, minimax needs to be fixed as it always returns an AI win.