Replace Inline Scripts Where Removed

Currently, when inline scripts, replaced, they are placed at the end of the document. This is problematic in situations where the order of the script is important such as in polymer elements where the script must appear within the tag.