IoT-Enabled Real-Time Management of Smart Grids with Demand Response Aggregators