Add marshalling for arbitrary functions in the IO monad.