a bit of a mess to support mutually recursive functions, though global env will only have the top-level binding of the deps