RFC: add multimedia I/O mechanism (display, mm_write, and friends); fixes #3817

This patch addresses #3817 to provide a general mechanism in Julia to display objects via rich multimedia representations, via three components:

* A function `display(x)` to request the richest available multimedia display of a Julia object `x` (with a text/plain fallback).
* Overloading `writemime` allows one to indicate arbitrary multimedia representations (keyed by standard MIME types) of user-defined types.
* Multimedia-capable display backends may be registered by subclassing a generic ``Display`` type and pushing them onto a stack of display backends via  `pushdisplay`.

This design has gone through several iterations since the inception of #3817, and is in part inspired by the [design of IPython's custom display logic](http://nbviewer.ipython.org/url/github.com/ipython/ipython/raw/master/examples/notebooks/Custom%20Display%20Logic.ipynb).  It is especially critical for the development of IJulia, where I have tested this technique and found that it works very well.

The main difference from my most recent proposal in #3817 is that I generalized the mechanism to be extensible to arbitrary MIME types without modifying `Base`, using a parametric singleton-type technique similar to @StefanKarpinski's beautiful `MathConst` trick in order to allow Julia to dispatch on the MIME type.   For example, if I have a type `MyImage` that I know how to write as PNG, I can simply define a new `writemime` method:
```
import Base.writemime
writemime(stream, ::@MIME("image/png"), x::MyImage) = ...write x as PNG to stream...
```
and any ``MyImage`` object will automatically display as a PNG image in IJulia or in any other display device supporting image/png.

See the changes to `doc/stdlib/base.rst` for the complete documentation.

I also added and documented a `base64(x)` function to base64-encode binary data, as this is generically useful for sending MIME data to backends over string-based transport protocols (and is essential for IJulia), based on some code by @StefanKarpinski.

cc: @JeffBezanson, @ViralShah, @timholy, @fperez, @loladiro