Updated course copy script, made more generic and flexible

also caches course copies.