TinyReef: a register-based virtual machine for Wireless Sensor Networks