added shutdown server func for emacs graceful shutdown w/server; it's
not 100% tested so BEWARE