moves app js from end of doc to header so only one js file gets loaded