A Runtime System for Memory-Constrained Networked Embedded Systems