Add a move_file like copy_file.
Replace shellcmd calls with move_file and copy_file