Fix support for custom formatters

Obsoletes #130.

/cc @pminten @ericmj