Aggregate Programming for the Internet of Things