System Support for Intermittent Computing