Relplace document.write 

Was running into issues where document.write would empty the page if the buffer was already closed. Made the style be appended as part of the init functions