refactor scope resolution to create fewer blocks and treat binding groups more uniformly