Refactor socket binding/unbinding.

Allow restarting client/server multiple times.
Use `node-ip` for address detection.

Addresses issues #10 and #11.