diff --git a/Fay/Yesod.hs b/Fay/Yesod.hs
new file mode 100644
--- /dev/null
+++ b/Fay/Yesod.hs
@@ -0,0 +1,47 @@
+{-# LANGUAGE DeriveDataTypeable #-}
+{-# LANGUAGE CPP                #-}
+-- | Module to be shared between server and client.
+--
+-- This module must be valid for both GHC and Fay.
+module Fay.Yesod where
+
+import           Prelude
+#ifdef FAY
+import           FFI
+#else
+import           Fay.FFI
+#endif
+import           Data.Data
+
+-- | A proxy type for specifying what type a command should return. The final
+-- field for each data constructor in a command datatype should be @Returns@.
+data Returns a = Returns
+    deriving (Eq, Show, Read, Data, Typeable)
+
+-- | Call a command.
+call :: (Returns a -> command)
+     -> (a -> Fay ()) -- ^ Success Handler
+     -> Fay ()
+call f g = ajaxCommand (f Returns) g
+
+-- ! Call a command, handling errors as well
+callWithErrorHandling
+     :: (Returns a -> command)
+     -> (a -> Fay ()) -- ^ Success Handler
+     -> (Fay ())      -- ^ Failure Handler
+     -> Fay ()
+callWithErrorHandling f g h = ajaxCommandWithErrorHandling (f Returns) g h
+
+-- | Run the AJAX command.
+ajaxCommand :: Automatic command
+            -> (Automatic a -> Fay ()) -- ^ Success Handler
+            -> Fay ()
+ajaxCommand = ffi "jQuery['ajax']({ url: window['yesodFayCommandPath'], type: 'POST', data: { json: JSON.stringify(%1) }, dataType: 'json', success : %2})"
+
+-- | Run the AJAX command, handling errors as well
+ajaxCommandWithErrorHandling
+            :: Automatic command
+            -> (Automatic a -> Fay ()) -- ^ Success Handler
+            -> (Fay ())      -- ^ Failure Handler
+            -> Fay ()
+ajaxCommandWithErrorHandling = ffi "jQuery['ajax']({ url: window['yesodFayCommandPath'], type: 'POST', data: { json: JSON.stringify(%1) }, dataType: 'json', success : %2, error: %3})"
diff --git a/Language/Fay/Yesod.hs b/Language/Fay/Yesod.hs
deleted file mode 100644
--- a/Language/Fay/Yesod.hs
+++ /dev/null
@@ -1,73 +0,0 @@
-{-# LANGUAGE DeriveDataTypeable #-}
-{-# LANGUAGE CPP                #-}
--- | Module to be shared between server and client.
---
--- This module must be valid for both GHC and Fay.
-module Language.Fay.Yesod where
-
-import           Prelude
-#ifdef FAY
-import           FFI
-#else
-import           Fay.FFI
-#endif
-import           Data.Data
-
-#ifdef FAY
-
-data Text = Text
-    deriving (Show, Read, Eq, Typeable, Data)
-
-fromString :: String -> Text
-fromString = ffi "%1"
-
-toString :: Text -> String
-toString = ffi "%1"
-
-#else
-
-import qualified Data.Text as T
-
-type Text = T.Text
-
-fromString :: String -> Text
-fromString = T.pack
-
-toString :: Text -> String
-toString = T.unpack
-
-#endif
-
--- | A proxy type for specifying what type a command should return. The final
--- field for each data constructor in a command datatype should be @Returns@.
-data Returns a = Returns
-    deriving (Eq, Show, Read, Data, Typeable)
-
--- | Call a command.
-call :: (Returns a -> command)
-     -> (a -> Fay ()) -- ^ Success Handler
-     -> Fay ()
-call f g = ajaxCommand (f Returns) g
-
--- ! Call a command, handling errors as well
-callWithErrorHandling
-     :: (Returns a -> command)
-     -> (a -> Fay ()) -- ^ Success Handler
-     -> (Fay ())      -- ^ Failure Handler
-     -> Fay ()
-callWithErrorHandling f g h = ajaxCommandWithErrorHandling (f Returns) g h
-
--- | Run the AJAX command.
-ajaxCommand :: Automatic command
-            -> (Automatic a -> Fay ()) -- ^ Success Handler
-            -> Fay ()
-ajaxCommand = ffi "jQuery['ajax']({ url: window['yesodFayCommandPath'], type: 'POST', data: { json: JSON.stringify(%1) }, dataType: 'json', success : %2})"
-
--- | Run the AJAX command, handling errors as well
-ajaxCommandWithErrorHandling
-            :: Automatic command
-            -> (Automatic a -> Fay ()) -- ^ Success Handler
-            -> (Fay ())      -- ^ Failure Handler
-            -> Fay ()
-ajaxCommandWithErrorHandling = ffi "jQuery['ajax']({ url: window['yesodFayCommandPath'], type: 'POST', data: { json: JSON.stringify(%1) }, dataType: 'json', success : %2, error: %3})"
-
diff --git a/Yesod/Fay.hs b/Yesod/Fay.hs
--- a/Yesod/Fay.hs
+++ b/Yesod/Fay.hs
@@ -20,11 +20,11 @@
 -- containing client-side code, and @fay-shared@ containing code to be used by
 -- both the client and server.
 --
--- The @Language.Fay.Yesod@ module (part of this package) is
+-- The @Fay.Yesod@ module (part of this package) is
 -- required by both client and server code. However, since Fay does not
 -- currently have package management support, we use a bit of a hack: the TH
 -- calls in this package will automatically create the necessary
--- @fay\/Language\/Fay\/Yesod.hs@ file.  Ultimately, we will use a more elegant
+-- @fay\/Fay\/Yesod.hs@ file.  Ultimately, we will use a more elegant
 -- solution.
 --
 -- In the future, if this package proves popular enough, Fay support will
@@ -129,7 +129,7 @@
                                              configPrettyPrint,
                                              CompileError)
 #endif
-import           Language.Fay.Yesod         (Returns (Returns))
+import           Fay.Yesod         (Returns (Returns))
 import           Language.Haskell.TH.Syntax (Exp (LitE, AppE, VarE), Lit (StringL, StringPrimL, IntegerL), Name,
                                              Q,
                                              qAddDependentFile, qRunIO)
@@ -176,7 +176,7 @@
     --
     --   Most users won't need to define this, the default is @const showToFay@.
     --   Custom definitions will usually be in terms of 'encodeFay'.
-    fayEncode :: (Show a, Data a) => master -> a -> Maybe Value
+    fayEncode :: (Data a) => master -> a -> Maybe Value
     fayEncode = const showToFay
 
 -- | A function provided by the developer describing how to answer individual
@@ -192,7 +192,7 @@
 -- and produces the expected result.
 type CommandHandler master
     = forall s.
-      (forall a. (Show a, Data a) => Returns a -> a -> HandlerT master IO s)
+      (forall a. (Data a) => Returns a -> a -> HandlerT master IO s)
    -> Value
    -> HandlerT master IO s
 
@@ -257,11 +257,11 @@
           returnJson $ fayEncode master value -- FIXME what should we do for Nothing values?
 
 langYesodFay :: String
-langYesodFay = $(qRunIO $ fmap (LitE . StringL . unpack) $ readTextFile "Language/Fay/Yesod.hs")
+langYesodFay = $(qRunIO $ fmap (LitE . StringL . unpack) $ readTextFile "Fay/Yesod.hs")
 
 writeYesodFay :: IO ()
 writeYesodFay = do
-    let fp = "fay/Language/Fay/Yesod.hs"
+    let fp = "fay/Fay/Yesod.hs"
         content = "-- NOTE: This file is auto-generated.\n" ++ langYesodFay
     exists <- isFile fp
     mcurrent <-
@@ -318,7 +318,8 @@
         Left e -> return (Left e)
         Right (sourceAndFiles -> (source',files)) -> do
           let fps = filter ours files
-              source = "\n(function(){\n" ++ source' ++ "\n})();\n"
+              source | configExportRuntime conf = "\n(function(){\n" ++ source' ++ "\n})();\n"
+                     | otherwise = source'
               (fp_hi,fp_o) = refreshTo
           writeFile fp_hi (unlines fps)
           writeFile fp_o source
diff --git a/yesod-fay.cabal b/yesod-fay.cabal
--- a/yesod-fay.cabal
+++ b/yesod-fay.cabal
@@ -1,5 +1,5 @@
 name:                yesod-fay
-version:             0.6.1
+version:             0.7.0
 synopsis:            Utilities for using the Fay Haskell-to-JS compiler with Yesod.
 description:         For initial discussion, see <http://www.yesodweb.com/blog/2012/10/yesod-fay-js>. This is a work-in-progress.
 homepage:            https://github.com/fpco/yesod-fay
@@ -13,11 +13,11 @@
 
 library
   exposed-modules:     Yesod.Fay
-                       Language.Fay.Yesod
+                       Fay.Yesod
   other-modules:       Yesod.Fay.Data
   build-depends:       base >= 4 && < 5
-                     , fay  >= 0.16
-                     , fay-text
+                     , fay >= 0.21.2.1
+                     , fay-dom >= 0.5
                      , transformers >= 0.2
                      , aeson >= 0.6
                      , bytestring >= 0.9
