moved some logic into DohaskellFunc monad, minor refactoring

\chebert