Remove dupe code and see how this compares to bincode. Add benchmarks to justify custom serialize and also experiment with safe solutions.
Also reduce some code duplication with cleanup_dirs fn.