Refactoring of the 'dx cp' command, adding another test case to the test suite.