Extract profilling into formatter

Start of a solution to #1504, creates a new `dump_profile` notifications, extracts the relevant shared logic into it, and then implements the old behaviour via an additional formatter that's added in from config, or at leasts that's the idea. The `JSONFormatter` also implement's it's own handler for mixed output.

Thoughts?