Generalize script copying code

In preparation for having script subdirectories