Add support for unbound variables, closures and frames in untyped ir