Format failures via a static method

To allow for customized formatting of failures create and
use a tiny helper function that can be used to alter how
failures are formatted to better suite the users needs.

This allows for users to dervive from the top level class and
adjust there formatting for how they see fit (as long as they
return the same two values that the methods api defines).

Change-Id: Ib91bd28ff4f24d831bb97715282ee8f3b6050c4c
Merge "Format failures via a static method"