Improve final()
Fix for compatibility
Improve on_source hook timing
Add tsort test
Add parse tests
Update test files