spec: use the yaml title as the HTML title
spec: add syntax highlighting for scala code with highlight.js

This adds syntax highlighting for all code scala blocks. Highlighting is
done after MathJax is done rendering so that latex can be used in code
blocks (and it currently *is* used).

Sadly Scala isn't common enough to be bundled in the highlight.min.js
available from CDNs, so we commit a local version of version 8.2 with
only scala bundled in it. The only other language used (ebnf) isn't
supported by highlight.js.
spec: fix latex formatting all over the place

Two things worth mentioning:

 - `\em` and `emph` are not supported by MathJax,
 - and things like `\mathcal{C}_0` require escaping the `_`,
   otherwise markdown sees it as the beginning of  `_some string_`.
   It doesn't happen without the closing bracket in front, e.g. in `b_0`.
spec: remove trailing whitespace everywhere
spec: fix broken links and anchors, including examples

For examples, the "name" of the example (like "Example Ordered") is only
used to derived its html id so that one can link to it (see
`layouts/default.yml`). Ideally all examples should have a name; here I
only added enough to satisfy existing links.
Merge pull request #3984 from gourlaysama/wip/spec

General formatting improvements in the spec