Add custom "%n" formatters

Implements the idea in #97.

The logic to implement the formatters gets a little funky, particularly the "placeholder" replacing logic to guard against `%%`.