     return
   window.FACTLINK_LOADED = true
 
+  # Add styles
+  style_tag = (mkEl 'style') null, document.createTextNode(style_code)
+  document.getElementsByTagName('head')[0].appendChild style_tag
+
   #### Create iframe so jslib's namespace (window) doesn't collide with any content window.
-  jslib_jail_iframe = document.createElement('iframe')
+  jslib_jail_iframe = (mkEl 'iframe') 'factlink-iframe'
   jslib_jail_iframe.style.display = 'block'
   jslib_jail_iframe.style.border = '0px solid transparent'
-  jslib_jail_iframe.id = 'factlink-iframe'
 
   # Wrappers for increased CSS specificity
   outerWrapperEl =
-    mkDiv 'fl-wrapper-1',
-      mkDiv 'fl-wrapper-2',
-        mkDiv 'fl-wrapper-3',
-          mkDiv 'fl', jslib_jail_iframe
-
-  # Keep in sync with #fl-wrapper-1 in basic.less
-  outerWrapperEl.style.visibility = 'hidden'; # Prevent showing stuff when css is not loaded yet
-  outerWrapperEl.style.position = 'absolute'; # Prevent reflowing of the page
+    mkEl 'div', 'fl-wrapper-1',
+      mkEl 'div', 'fl-wrapper-2',
+        mkEl 'div', 'fl-wrapper-3',
+          mkEl 'div', 'fl', jslib_jail_iframe
 
   document.body.appendChild outerWrapperEl
 


  script_tag = jslib_jail_doc.createElement 'script'
  script_tag.appendChild(
    jslib_jail_doc.createTextNode("""window.FactlinkConfig = #{JSON.stringify(window.FactlinkConfig)};

#{jslib_jail_code};

window.parent.FACTLINK_ON_CORE_LOAD();
"""))
  jslib_jail_doc.documentElement.appendChild(script_tag)

  style_tag = (mkEl 'style') null, document.createTextNode(style_code)
  document.getElementsByTagName('head')[0].appendChild style_tag

jslib_jail_code = __INLINE_JS_PLACEHOLDER__
style_code = __INLINE_CSS_PLACEHOLDER__


  window.FACTLINK_ON_CORE_LOAD = ->
    # This seems to be necessary, don't understand entirely why
#    window.FACTLINK.easyXDM = jslib_jail_iframe.contentWindow.Factlink.easyXDM

    for methodCall in storedMethodCalls
      jslib_jail_iframe.contentWindow.Factlink[methodCall.name](methodCall.arguments...)
    storedMethodCalls = []

  jslib_jail_iframe.contentWindow.FactlinkConfig = window.FactlinkConfig
  #### Load iframe with script tag
  jslib_jail_doc = jslib_jail_iframe.contentWindow.document

