Improvements and fixes to SyntaxScaffold
- Fixed parent ref being accessed in a way that always returned null
- Added parent type-based finding
- Added depth tracking