PID control, debugging code, code enhancements

This PR contains:

* code to control signals (useful for init.d / upstart / systemd control)
* debugging code (let's you know which PID is using the port the script is trying to listen on)
* some general code cleanup/enhancement