Adds support for a fail callback

Per #219, this commit adds support for a fail callback. It works in pretty much the same way the the success callback works. Although I can't find a usecase for it off the top of my head, I left in the ability to set a newValue.