* Adding a close method for graceful shutdown

@ronkorving could you have a quick look? I will test it further with some of our tools in the next few hours.
The problem with emitting "error" is that now I *must* listen for that event, despite my callback. The reason being that Node.js will by default throw an uncatchable exception when error is emitted without listeners.