Remove source_dup
Refactored analyze_ref
Change how scope lookup works
Add destroy and copy actions.