Fix type soundness

Show that it gives the no duplicate module/types properties that the new
whole-prog semantics requires.