Backup and restore the entire require cache

Fixes #1