Resolve dependencies using scope

When resolving by class in a scope, dependencies will be resolved from the same scope if possible. otherwise, dependencies will be resolved from the default scope.