Moved message functions from daemon to library.

Necessary to log library functions as well.