The usage of subprocess.run is recommended since python 3.5. Popen, check_call, call and check_output calls were replaced with run.
Closes #783.