move template options to config
move js scripts to top of layout