Convert to new diagnostics

This pairs almost every error in libsyntax and librustc with an error code,
emitting with the macros:

* alert_fatal!(cx, code, fmt, args);
* alert_err!(cx, code, fmt, args);
* alert_warn!(cx, code, fmt, args);
* span_fatal!(cx, span, code, fmt, args);
* span_err!(cx, span, code, fmt, args);
* span_warn!(cx, span, code, fmt, args);
* resolve_err!(cx, span, code, fmt, args);

These macros call the methods 'fatal_without_diagnostic_code' etc. on any
given context. For the most part the old diagnostic methods on the various
sessions and handles and contexts have been renamed in a way that is
obnoxious to call (use the macros), but the macro ExtCtxt still contains
the simple `fatal` methods, etc. for ease of use by out of tree procedural
macros.

Lint errors are difficult to convert to this system because they don't use
string literals for reporting errors, so they don't have their own codes yet.
rustc: Add UI for extended diagnostics

When diagnostics with codes are emitted they appear in magenta brackets,
like `[A0002]`. After failure a note is emitted indicating whether
any errors had extended documentation and suggesting the `--explain help`
flag.
Slightly improve the format of the diagnostic database.