Register and retrieve formatters

Instead of hard-coding each one into a case statement.