Made Typechecking into its own pass by decoupling it from effect checking.
(The code is currently ugly and there's a slight regression in one test but I'm
working on those :))