allow formatters to specify metadata

Part of [IPEP 13](https://github.com/ipython/ipython/wiki/IPEP-13%3A-Updating-the-Message-Spec).

A formatter can now return `(data, metadata)`, in addition to just `data`.

A display_data message may now have a key in the content's existing metadata field for each format type.
These keys are not necessarily defined.

The main initial use of this code is to allow images to specify display size,
which should be the missing piece before implementing 2x figures (#2234).

Pinging @piti118, who plans to do that implementation on top of this.