Display log file name on failure to open file

Also, make owl_log_error be like printf.  This will be more useful in
the next commit, when we display error codes.
Moved log generation code to perl.
Made owl_util_makepath available from perl

There's probably a better way to do this.  Maybe

sub makepath {
        my $filename = shift;
        $filename =~ s{ ^ ~ ( [^/]* ) } { $1 ? (getpwnam($1))[7]
        : ( $ENV{HOME} || $ENV{LOGDIR} || (getpwuid($>))[7] ) }ex;
        return $filename;
}
(http://docstore.mik.ua/orelly/perl/cookbook/ch07_04.htm) or something.

Additionally, I'm not sure why

 PREINIT:
   char *rv = NULL;
 CODE:
 {
   rv = foo();
   RETVAL = rv;
 }
 OUTPUT:
   RETVAL
 CLEANUP:
   g_free(rv);

is the paradigm for functions returning strings, when foo returns `char
*` and not `const char *`.  I've removed the `= NULL` part of the
initlization, which I assume is left over from when we had to NULL-check
things before freeing them, but I've copied the rest of the code.
Moved log file name generation to perl

I don't think that the class/personal distinction is the best for
general protocols, but I don't know what should replace it.  I've made
class-logging default to only zephyr (a slight change from previous
behavior, where jabber MUC's would be logged to $classlogpath, as well
as all non-private non-login messages from other protocols), but made
logging path generation overridable.

TODO: Decide whether or not to filter out more 'bad' characters.
Perhaps we should remove '!' because it indicates history in some shells
and makes things obnoxious, or '~' becase it indicates homedirs in many
shells.
* '/' is for separating directories, and we don't want to accidentally
  make subdirectories

We first NFKC for zephyrs, and then apply lc.  The zephyr servers
apply case-folded NFKC (so says
http://zephyr.1ts.org/browser/zephyr/server/zstring.c).  We should
probably use Unicode::CaseFold instead of lc.  I'm also not sure what
the order case-adjustment and normalization should be.

We first NFKC, then apply lc, to jabbers, as per
http://xmpp.org/internet-drafts/attic/draft-ietf-xmpp-nodeprep-03.html
(though I can't actually find anything that specifies the case-folding
algorithm, nor the ordering).

We now use lc instead of g_utf8_strdown to normalize AIM screennames.
Scrapped the last bits of C code dealing with jabber.

We still have an OWL_PROTOCOL_JABBER in owl.h, but it does no harm being
there, and we don't use any of the other ones except for AIM.  I figure
there's no harm in waiting and ripping all of them out at the same time
in perl/AIM
Moved outgoing zephyr error logging to perl
Moved the checking of whether or not to log messages to perl
Moved notification of message logging to perl
Moved logging-specific variables to perl

But only the ones that could be moved losslessly, i.e., no special
validsettings and not enums.
Moved the last of the logging-related variables to perl

We seem to have picked logpath as the string variable we test in
tester.c.  Since this is no longer in C, I've replaced it with
personalbell (no particular reason for that choice).
Ignore kerberos instances in the sender and recipient when logging

This fixes trac-#151 (Handle logging of personal zephyrs from different
instances of Kerberos principals sanely).  Stripping the instance is
only done for the filename, not for the actual log contents.
Log different realms to different files
Add IRC logging filename generation

Based on asedeno's comment
"For IRC I'd probably want a combination of network and (channel or
nick)."
Log to subfolders of a base path

A different subfolder for each protocol.
Remove irc: from irc message filenames
Add a comment about existence of logging dirs
Update IRC logging to be more idiomatic

Based on a message from kini on #oplss at 2013-07-27 12:40:
   freenode / #oplss / kini  2013-07-27 12:40  (kini!kini@unaffiliated/kini)
       jgross: the standard format is "[timestamp] <username> message", one line per message
   freenode / #oplss / kini  2013-07-27 12:41  (kini!kini@unaffiliated/kini)
       non-message events are usually notated as "* event description", e.g. "* kini (unaffiliated/kini) joined
       #oplss", or whatever
Use g_utf8_casefold and g_utf8_normalize

We define a convenience function compat_casefold in util.c for reuse in
filters.
Add log-to-subdirectories, a compatibility frob

If disabled (the default), then logging of jabber and AIM messages
behaves how it used to.  If enabled, then each protocol gets its own
subdirectory.
Log loopbacks to loopback file in ~/zlog

Not to ~/zlog/loop{sender,recip}.  If compatibility logging is on,
loopbacks get logged to ~/zlog/people/loopback, which is what happened
before this branch.