Added 'validate' feature to copy and template modules,

Optionally makes copy or template fail if validate fails

This PR covers previous #2512 and #2513