Breaking out common subfunctions into a separate module.
Fork sort and makeblastdb calls; use tempfiles and clean them up.