The economics of electricity markets, theory and policy