From http://stackoverflow.com/questions/17510756/chaining-promises-in-coffeescript