A Distributed IoT Infrastructure to Test and Deploy Real-Time Demand Response in Smart Grids