add retire_tmp lib function and start using it instead of just rm'ing tempfiles when done with them