Collective Abstractions and Platforms for Large-Scale Self-Adaptive IoT