Bug 958238 - The X-UA-Compatible meta element is placed to late in the document

also the element containing the character encoding declaration must be serialized completely within the first 1024 bytes of the document so i did that as well.