Added scope code and interfaces in CodeGen to look up enclosing routines