Transitioning to import tempfiles

Many temporary files were being made and deleted with subprocess.call(),
might as well use an actual library for it. Also added a few comments
explaining command line arguments