Electricity Rate Design for Integrating Distributed Resources Into Energy Systems