Keep all non-src attributes when inlining scripts
Refactor script inlining