A library for state-preserving restarting of programs