Formatter refactor

Maybe a nicer way of using the formatter.

The formatter method now returns the formatter instead of the array. Also moved the recursion into a private method so the interface for the method is better.

If no formatter is provided then it used the default one.