diff --git a/ChangeLog b/ChangeLog
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
+2013-09-16 v3.0.1
+	* Exporting more low level APIs.
+	* Adding "-ibuild/autogen"
+	* Adding "-optP". (Macros from a Cabal file
+	  and "dist/build/autogen/cabal_macros.h")
+
 2013-09-06 v3.0.0
 	* Supporting the sandbox of cabal 1.18.
-	* Obsoleting the support for cabal-dev
+	* Obsoleting the support for cabal-dev.
 
 2013-09-04 v2.1.2
 	* Supporting multiple target files. (@nh2)
diff --git a/Language/Haskell/GhcMod/CabalApi.hs b/Language/Haskell/GhcMod/CabalApi.hs
--- a/Language/Haskell/GhcMod/CabalApi.hs
+++ b/Language/Haskell/GhcMod/CabalApi.hs
@@ -3,9 +3,9 @@
 module Language.Haskell.GhcMod.CabalApi (
     fromCabalFile
   , parseCabalFile
-  , cabalAllDependPackages
-  , cabalAllSourceDirs
   , cabalAllBuildInfo
+  , cabalDependPackages
+  , cabalSourceDirs
   , getGHCVersion
   ) where
 
@@ -32,6 +32,9 @@
 
 ----------------------------------------------------------------
 
+-- | Parsing a cabal file in 'Cradle' and returns
+--   options for GHC, include directories for modules and
+--   package names of dependency.
 fromCabalFile :: [GHCOption]
               -> Cradle
               -> IO ([GHCOption],[IncludeDir],[Package])
@@ -41,7 +44,7 @@
   where
     Just cfile = cradleCabalFile cradle
 
-cookInfo :: [String] -> Cradle -> PackageDescription
+cookInfo :: [GHCOption] -> Cradle -> PackageDescription
          -> ([GHCOption],[IncludeDir],[Package])
 cookInfo ghcOptions cradle cabal = (gopts,idirs,depPkgs)
   where
@@ -49,21 +52,41 @@
     Just cdir  = cradleCabalDir   cradle
     Just cfile = cradleCabalFile  cradle
     buildInfos = cabalAllBuildInfo cabal
-    gopts      = getGHCOptions ghcOptions $ head buildInfos
-    idirs      = includeDirectories cdir wdir $ cabalAllSourceDirs buildInfos
-    depPkgs    = removeMe cfile $ cabalAllDependPackages buildInfos
+    gopts      = getGHCOptions ghcOptions cdir $ head buildInfos
+    idirs      = includeDirectories cdir wdir $ cabalSourceDirs buildInfos
+    depPkgs    = removeThem problematicPackages $ removeMe cfile $ cabalDependPackages buildInfos
 
-removeMe :: FilePath -> [String] -> [String]
+----------------------------------------------------------------
+-- Dependent packages
+
+removeMe :: FilePath -> [Package] -> [Package]
 removeMe cabalfile = filter (/= me)
   where
     me = dropExtension $ takeFileName cabalfile
 
-includeDirectories :: String -> String -> [FilePath] -> [String]
-includeDirectories cdir wdir []   = uniqueAndSort [cdir,wdir]
-includeDirectories cdir wdir dirs = uniqueAndSort (map (cdir </>) dirs ++ [cdir,wdir])
+removeThem :: [Package] -> [Package] -> [Package]
+removeThem badpkgs = filter (`notElem` badpkgs)
 
+problematicPackages :: [Package]
+problematicPackages = [
+    "base-compat" -- providing "Prelude"
+  ]
+
 ----------------------------------------------------------------
+-- Include directories for modules
 
+cabalBuildDirs :: [FilePath]
+cabalBuildDirs = ["dist/build"]
+
+includeDirectories :: FilePath -> FilePath -> [FilePath] -> [FilePath]
+includeDirectories cdir wdir dirs = uniqueAndSort (extdirs ++ [cdir,wdir])
+  where
+    extdirs = map (cdir </>) $ dirs ++ cabalBuildDirs
+
+----------------------------------------------------------------
+
+-- | Parsing a cabal file and returns 'PackageDescription'.
+--   'IOException' is thrown if parsing fails.
 parseCabalFile :: FilePath -> IO PackageDescription
 parseCabalFile file = do
     cid <- getGHCId
@@ -81,16 +104,21 @@
 
 ----------------------------------------------------------------
 
-getGHCOptions :: [String] -> BuildInfo -> [String]
-getGHCOptions ghcOptions binfo = ghcOptions ++ exts ++ [lang] ++ libs ++ libDirs
+getGHCOptions :: [GHCOption] -> FilePath -> BuildInfo -> [GHCOption]
+getGHCOptions ghcOptions cdir binfo = ghcOptions ++ exts ++ [lang] ++ libs ++ libDirs ++ cpps
   where
-    exts = map (("-X" ++) . display) $ usedExtensions binfo
     lang = maybe "-XHaskell98" (("-X" ++) . display) $ defaultLanguage binfo
-    libs = map ("-l" ++) $ extraLibs binfo
     libDirs = map ("-L" ++) $ extraLibDirs binfo
+    exts = map (("-X" ++) . display) $ usedExtensions binfo
+    libs = map ("-l" ++) $ extraLibs binfo
+    cpps = map ("-optP" ++) $ cppOptions binfo ++ cabalCppOptions cdir
 
+cabalCppOptions :: FilePath -> [String]
+cabalCppOptions dir = ["-include", dir </> "dist/build/autogen/cabal_macros.h"]
+
 ----------------------------------------------------------------
 
+-- | Extracting all 'BuildInfo' for libraries, executables, tests and benchmarks.
 cabalAllBuildInfo :: PackageDescription -> [BuildInfo]
 cabalAllBuildInfo pd = libBI ++ execBI ++ testBI ++ benchBI
   where
@@ -101,16 +129,18 @@
 
 ----------------------------------------------------------------
 
-cabalAllSourceDirs :: [BuildInfo] -> [FilePath]
-cabalAllSourceDirs bis = uniqueAndSort $ concatMap hsSourceDirs bis
-
-----------------------------------------------------------------
-
-cabalAllDependPackages :: [BuildInfo] -> [Package]
-cabalAllDependPackages bis = uniqueAndSort $ pkgs
+-- | Extracting package names of dependency.
+cabalDependPackages :: [BuildInfo] -> [Package]
+cabalDependPackages bis = uniqueAndSort $ pkgs
   where
     pkgs = map getDependencyPackageName $ concatMap targetBuildDepends bis
     getDependencyPackageName (Dependency (PackageName nm) _) = nm
+
+----------------------------------------------------------------
+
+-- | Extracting include directories for modules.
+cabalSourceDirs :: [BuildInfo] -> [IncludeDir]
+cabalSourceDirs bis = uniqueAndSort $ concatMap hsSourceDirs bis
 
 ----------------------------------------------------------------
 
diff --git a/Language/Haskell/GhcMod/GHCApi.hs b/Language/Haskell/GhcMod/GHCApi.hs
--- a/Language/Haskell/GhcMod/GHCApi.hs
+++ b/Language/Haskell/GhcMod/GHCApi.hs
@@ -96,6 +96,8 @@
 
 ----------------------------------------------------------------
 
+-- | Initialize the 'DynFlags' relating to the compilation of a single
+-- file or GHC session.
 initializeFlags :: GhcMonad m => Options -> m ()
 initializeFlags opt = do
     dflags0 <- getSessionDynFlags
@@ -146,7 +148,7 @@
 
 ----------------------------------------------------------------
 
-modifyFlagsWithOpts :: GhcMonad m => DynFlags -> [String] -> m DynFlags
+modifyFlagsWithOpts :: GhcMonad m => DynFlags -> [GHCOption] -> m DynFlags
 modifyFlagsWithOpts dflags cmdOpts =
     tfst <$> parseDynamicFlags dflags (map noLoc cmdOpts)
   where
@@ -155,7 +157,7 @@
 ----------------------------------------------------------------
 
 -- | Set the files that GHC will load / compile.
-setTargetFiles :: (GhcMonad m) => [String] -> m ()
+setTargetFiles :: (GhcMonad m) => [FilePath] -> m ()
 setTargetFiles [] = error "ghc-mod: setTargetFiles: No target files given"
 setTargetFiles files = do
     targets <- forM files $ \file -> guessTarget file Nothing
@@ -167,6 +169,8 @@
 getDynamicFlags :: IO DynFlags
 getDynamicFlags = runGhc (Just libdir) getSessionDynFlags
 
+-- | Checking if Template Haskell or quasi quotes are used.
+--   If not, the process can be faster.
 canCheckFast :: ModuleGraph -> Bool
 canCheckFast = not . any (hasTHorQQ . ms_hspp_opts)
   where
diff --git a/Language/Haskell/GhcMod/GHCChoice.hs b/Language/Haskell/GhcMod/GHCChoice.hs
--- a/Language/Haskell/GhcMod/GHCChoice.hs
+++ b/Language/Haskell/GhcMod/GHCChoice.hs
@@ -9,20 +9,22 @@
 
 ----------------------------------------------------------------
 
+-- | Try the left 'Ghc' action. If 'IOException' occurs, try
+--   the right 'Ghc' action.
 (||>) :: Ghc a -> Ghc a -> Ghc a
 x ||> y = x `gcatch` (\(_ :: IOException) -> y)
 
-(|||>) :: GhcMonad m => m a -> m a -> m a
-x |||> y = x `gcatch` (\(_ :: IOException) -> y)
-
-----------------------------------------------------------------
-
-{-| Go to the next 'Ghc' monad by throwing 'AltGhcgoNext'.
--}
+-- | Go to the next 'Ghc' monad by throwing 'AltGhcgoNext'.
 goNext :: Ghc a
 goNext = liftIO . throwIO $ userError "goNext"
 
-{-| Run any one 'Ghc' monad.
--}
+-- | Run any one 'Ghc' monad.
 runAnyOne :: [Ghc a] -> Ghc a
 runAnyOne = foldr (||>) goNext
+
+----------------------------------------------------------------
+
+-- | Try the left 'GhcMonad' action. If 'IOException' occurs, try
+--   the right 'GhcMonad' action.
+(|||>) :: GhcMonad m => m a -> m a -> m a
+x |||> y = x `gcatch` (\(_ :: IOException) -> y)
diff --git a/Language/Haskell/GhcMod/Internal.hs b/Language/Haskell/GhcMod/Internal.hs
--- a/Language/Haskell/GhcMod/Internal.hs
+++ b/Language/Haskell/GhcMod/Internal.hs
@@ -1,16 +1,37 @@
 -- | Low level access to the ghc-mod library.
 
 module Language.Haskell.GhcMod.Internal (
-  -- * Low level access
+  -- * Types
     LogReader
   , GHCOption
+  , Package
+  , IncludeDir
+  -- * Cabal API
+  , fromCabalFile
+  , parseCabalFile
+  , cabalAllBuildInfo
+  , cabalDependPackages
+  , cabalSourceDirs
+  -- * GHC API
+  , canCheckFast
+  -- * Getting 'DynFlags'
+  , getDynamicFlags
+  -- * Initializing 'DynFlags'
+  , initializeFlags
   , initializeFlagsWithCradle
+  -- * 'GhcMonad'
   , setTargetFiles
   , checkSlowAndSet
-  , getDynamicFlags
+  -- * 'Ghc' Choice
+  , (||>)
+  , goNext
+  , runAnyOne
+  -- * 'GhcMonad' Choice
+  , (|||>)
   ) where
 
+import Language.Haskell.GhcMod.CabalApi
 import Language.Haskell.GhcMod.ErrMsg
 import Language.Haskell.GhcMod.GHCApi
+import Language.Haskell.GhcMod.GHCChoice
 import Language.Haskell.GhcMod.Types
-
diff --git a/Language/Haskell/GhcMod/Types.hs b/Language/Haskell/GhcMod/Types.hs
--- a/Language/Haskell/GhcMod/Types.hs
+++ b/Language/Haskell/GhcMod/Types.hs
@@ -94,7 +94,10 @@
 -- | A single GHC option, as it would appear on the command line.
 type GHCOption  = String
 
+-- | Include directories for modules
 type IncludeDir = FilePath
+
+-- | Package names
 type Package    = String
 
 -- | GHC version in 'String'.
diff --git a/ghc-mod.cabal b/ghc-mod.cabal
--- a/ghc-mod.cabal
+++ b/ghc-mod.cabal
@@ -1,5 +1,5 @@
 Name:                   ghc-mod
-Version:                3.0.0
+Version:                3.0.1
 Author:                 Kazu Yamamoto <kazu@iij.ad.jp>
 Maintainer:             Kazu Yamamoto <kazu@iij.ad.jp>
 License:                BSD3
diff --git a/test/CabalApiSpec.hs b/test/CabalApiSpec.hs
--- a/test/CabalApiSpec.hs
+++ b/test/CabalApiSpec.hs
@@ -13,14 +13,14 @@
         it "throws an exception if the cabal file is broken" $ do
             parseCabalFile "test/data/broken-cabal/broken.cabal" `shouldThrow` (\(_::IOException) -> True)
 
-    describe "cabalAllDependPackages" $ do
+    describe "cabalDependPackages" $ do
         it "extracts dependent packages" $ do
-            pkgs <- cabalAllDependPackages . cabalAllBuildInfo <$> parseCabalFile "test/data/cabalapi.cabal"
+            pkgs <- cabalDependPackages . cabalAllBuildInfo <$> parseCabalFile "test/data/cabalapi.cabal"
             pkgs `shouldBe` ["Cabal","base","template-haskell"]
 
-    describe "cabalAllSourceDirs" $ do
+    describe "cabalSourceDirs" $ do
         it "extracts all hs-source-dirs" $ do
-            dirs <- cabalAllSourceDirs . cabalAllBuildInfo <$> parseCabalFile "test/data/check-test-subdir/check-test-subdir.cabal"
+            dirs <- cabalSourceDirs . cabalAllBuildInfo <$> parseCabalFile "test/data/check-test-subdir/check-test-subdir.cabal"
             dirs `shouldBe` ["src", "test"]
 
     describe "cabalBuildInfo" $ do
