Javascript Boggle board solver