refactor_symtab.py: remove redundant casts
handle more change scopes
add rename_symtab.py