Move script/css tags to appropriate spots in document