Implement sync to improve graceul shutdown

This is a somewhat technical change, but hte summary is that the main
routine now uses a sync.Cond to wait until it is interrupted to shut
down. The HTTP server now listens in its own goroutine and will not
report errors if ignoreServerCrash is true.

Close #97