Add tests that tracks down the dependency when attaching scoped singleton.
Calculate recursive scope dependency for singleton
Refactor the Calculate dep scope code