Make listen address and port configurable

Also add proper error handling when setting up the listening socket.
Merge pull request #151 from dnnr/listencfg

Make listen address and port configurable