Save and restore require function's cache