A Distributed Hierarchical Control Framework for Economic Dispatch and Frequency Regulation of Autonomous AC Microgrids