Testing async code using Mocha. From http://visionmedia.github.io/mocha/#asynchronous-code