Update handler for SIGPIPE - fix #7
Use logging module. Resolves #6