Three Essays On The Electricity Market, Distributed Generation, And Retail Tariff Designs