Add the ability to set templates dirty and add a refresher to update them

Also fix an issue that was making getDomArguments() missing names after extractDomArgument() was called.