move code for option --copyfiles to subroutine

Improve readabiliy of the main program by moving the code for (non-flac) file
copying to a subroutine.
Merge branch 'feature/copy_as_sub' into develop