Rebase of luite's ghc patch for ghcjs to the latest ghc master.