Added logging routines from APUE.
Changed error logging to APUE logging framework
Added daemonize function to have proxy run as a system daemon.