server: changes with an eye towards http support

* server.daemonize(), exit early, shed some indent ("Reject as many iterations as possible, as early as possible")
* moved host:port parsing into get_listen_addrs()
* add some tests
* whitespace cleanups
* jshint happiness