fix cabal builds

hsc2hs #def and cabal don't play well together
(https://github.com/haskell/cabal/issues/238)

so put the C helpers in their own files so cabal can know about them.