Revert "Revert "Add scope tracking to identifiers""

This reverts commit 5af52528c4e44142353d5ea1c60eaf368d5977e3.
Implement scope tracking
Update tests for scope flag
0.0.6