Tweaks to directives
Template scripts moved to top of respective files