Rewrite the entire logging system.•••- Much cleaner API for writing to the log.
- Adds support for stderr and stdout logging to the core.
- Adds support for sql and syslog logging in modules.
Only write to the pid file on boot.•••Being able to change this after first boot is error prone and does
not work well on system-wide installs where the server needs root
to write the file.
Closes #566.