Decentralized Programming for the Internet of Things