Added fork functionality and tests.