Backport useful failureResultOf from Twisted trunk.
Docstring updates, cosmetic updates, etc.