ir: Remove scope from Function, add scope to BlockStatement.