Changed to subprocess so can capture all stdout/stderr to a unified log file
Added option for tmp dir for bamtofastq