A Spatial Computing Approach to Programming Large Scale Wireless Sensor Networks