This PR adds the functionality of allowing custom scripts to be executed on template change. Resolves #2707