Moved os.system calls to subprocess.Popen... this allows all subprocesses to be killed as a group if needed.