Fetch missing theories on the fly

This fixes the dependency analysis for app and total theories.

A bug is still lurking around: a bottom of function type (TArr)
should depend on that theory.

This unfortunately somehow introduces new GHC.Prim.realWord#
in rotate:

== INIT CORE ==
[Rotate.rotate [Occ=LoopBreaker]
   :: Nat.Nat -> List.List -> List.List
 [LclIdX,
  Arity=2,
  Unf=Unf{Src=<vanilla>, TopLvl=True, Arity=2, Value=True,
          ConLike=True, Cheap=True, Expandable=True,
          Guidance=IF_ARGS [30 30] 340 10}]
 Rotate.rotate =
   \ (ds_d1fg :: Nat.Nat) (xs :: List.List) ->
     let {
       fail_d1fh :: GHC.Prim.State# GHC.Prim.RealWorld -> List.List
       [LclId,
        Arity=1,
        Unf=Unf{Src=<vanilla>, TopLvl=False, Arity=1, Value=True,
                ConLike=True, Cheap=True, Expandable=True,
                Guidance=IF_ARGS [0] 130 0}]
       fail_d1fh =
         \ _ ->
           Control.Exception.Base.patError
             @ List.List "Rotate.hs:(11,1)-(13,54)|function rotate" } in
     case ds_d1fg of wild_X8 {
       Nat.Z -> xs;
       Nat.S ipv ->
         case xs of wild_Xc {
           List.Cons ipv ipv ->
             case wild_X8 of _ {
               Nat.Z -> fail_d1fh GHC.Prim.realWorld#;
               Nat.S n ->
                 case wild_Xc of _ {
                   List.Cons x xs ->
                     Rotate.rotate n (List.++ xs (List.Cons x List.Nil));
                   List.Nil -> fail_d1fh GHC.Prim.realWorld#
                 }
             };
           List.Nil -> List.Nil
         }
     };,

This fails with

hipspec: monoType: GHC.Prim.State# GHC.Prim.RealWorld is not a simple type!

Maybe we can incorporate the contract checker's inliner here. Or a
simpler one.