Update log functions for new messagemgmt functions.

These updates will make the log and Helpmebot work with the new
functions.  The hard coded closes have been replaced with queries from
the database.