Use subprocess.communicate() instead of wait()

Fixes #4