Reorders template structure to allow use of layout.twig, thus allowing to validate the script tags correctly