System support for long-running programs on RFID-scale devices