Fixed short-circuited implementation of file and directory copies on remote hosts.

- Figured out the right incantations for cp, tar, copy and xcopy to execute.
- Fixed the itests.