Refactored some things to allow more flexibility.

Now you can do stuff like make JSON/XML formatters since it won't
call fmt.Sprint* before calling the formatter.
Merge branch 'refactor-for-json'