diff --git a/testTeXMathML.hs b/testTeXMathML.hs
deleted file mode 100644
--- a/testTeXMathML.hs
+++ /dev/null
@@ -1,33 +0,0 @@
-module Main where
-
-import Text.TeXMath
-import Text.XML.Light
-import Text.TeXMath.Macros
-import Text.ParserCombinators.Parsec
-import System.IO
-
-inHtml :: Element -> Element
-inHtml x =
-  add_attr (Attr (unqual "xmlns") "http://www.w3.org/1999/xhtml") $
-  unode "html"
-    [ unode "head" $
-        add_attr (Attr (unqual "content") "application/xhtml+xml; charset=UTF-8") $
-        add_attr (Attr (unqual "http-equiv") "Content-Type") $
-        unode "meta" ()
-    , unode "body" x ]
-
-stripMacroDefs :: Parser ([Macro], String)
-stripMacroDefs = do
-  macros <- many (try $ pSkipSpaceComments >> pMacroDefinition)
-  rest <- getInput
-  return (macros, rest)
-
-main :: IO ()
-main = do
-  inp <- getContents
-  case parse stripMacroDefs "stdin" inp of
-       Left err -> error $ show err
-       Right (ms, rest)->
-          case (texMathToMathML DisplayBlock $! applyMacros ms rest) of
-               Left err         -> hPutStrLn stderr err
-               Right v          -> putStr . ppTopElement . inHtml $ v
diff --git a/tests/runtests.sh b/tests/runtests.sh
--- a/tests/runtests.sh
+++ b/tests/runtests.sh
@@ -2,9 +2,9 @@
 # Note: this should be run from within the tests directory
 # Make sure you've set the 'test' flag using Cabal:
 # cabal install -ftest
-# Otherwise the test program won't be built.
+# Otherwise the test program 'texmath' won't be built.
 # Exit status is number of failed tests.
-TESTPROG=../dist/build/testTeXMathML/testTeXMathML
+TESTPROG=../dist/build/texmath/texmath
 failures=0
 if [ -f $TESTPROG ]; then
     for t in *.tex; do
diff --git a/texmath.cabal b/texmath.cabal
--- a/texmath.cabal
+++ b/texmath.cabal
@@ -1,11 +1,20 @@
 Name:                texmath
-Version:             0.3.1.3
+Version:             0.3.1.4
 Cabal-version:       >= 1.2
 Build-type:          Custom
 Synopsis:            Conversion of LaTeX math formulas to MathML.
 Description:         The texmathml library provides functions to convert LaTeX
                      math formulas to presentation MathML. It supports
-                     basic LaTeX and AMS extensions, but not macros.
+                     basic LaTeX and AMS extensions, and it can parse and
+                     apply LaTeX macros.
+                     .
+                     Use the @test@ flag to install a standalone executable,
+                     @texmath@, that reads a LaTeX formula from @stdin@ and
+                     writes MathML to @stdout@.
+                     .
+                     Use the @cgi@ flag to install a cgi script,
+                     @texmath-cgi@.
+
 Category:            Text
 Stability:           Experimental
 License:             GPL
@@ -74,8 +83,8 @@
       Ghc-Options:     -Wall
     Ghc-Prof-Options:  -auto-all -caf-all
 
-Executable testTeXMathML
-    Main-is:             testTeXMathML.hs
+Executable texmath
+    Main-is:             texmath.hs
     if impl(ghc >= 6.12)
       Ghc-Options:     -Wall -fno-warn-unused-do-bind
     else
diff --git a/texmath.hs b/texmath.hs
new file mode 100644
--- /dev/null
+++ b/texmath.hs
@@ -0,0 +1,33 @@
+module Main where
+
+import Text.TeXMath
+import Text.XML.Light
+import Text.TeXMath.Macros
+import Text.ParserCombinators.Parsec
+import System.IO
+
+inHtml :: Element -> Element
+inHtml x =
+  add_attr (Attr (unqual "xmlns") "http://www.w3.org/1999/xhtml") $
+  unode "html"
+    [ unode "head" $
+        add_attr (Attr (unqual "content") "application/xhtml+xml; charset=UTF-8") $
+        add_attr (Attr (unqual "http-equiv") "Content-Type") $
+        unode "meta" ()
+    , unode "body" x ]
+
+stripMacroDefs :: Parser ([Macro], String)
+stripMacroDefs = do
+  macros <- many (try $ pSkipSpaceComments >> pMacroDefinition)
+  rest <- getInput
+  return (macros, rest)
+
+main :: IO ()
+main = do
+  inp <- getContents
+  case parse stripMacroDefs "stdin" inp of
+       Left err -> error $ show err
+       Right (ms, rest)->
+          case (texMathToMathML DisplayBlock $! applyMacros ms rest) of
+               Left err         -> hPutStrLn stderr err
+               Right v          -> putStr . ppTopElement . inHtml $ v
