improved simple scope analyzer

see test case `Suite.SimpleScopeAnalyzer.hs` for a specification