Refactor distcp package and fix distcp test failures