add support for stopping server

I'm a beginner in go and figured I'd try to address #307 as a little exercise for learning purposes.  Here it is in case you can use any of it.