ir: Move scope from Function to the BlockStatements.
semantic: BlockStatement level scope management.