Cooperative Control of Microgrids: A Review of Theoretical Frameworks, Applications and Recent Developments