Refactored subprocesses as a class, added unit tests (dpipe_test.py)