FC Midtjylland er klar til gruppespillet i Champions League for første gang i klubbens historie efter en dramatisk 4-1-sejr over Slavia Prag.