Shared: Moved import of toChunks outside of conditional.

Closes #1590.
Use protocol-relative URL for mathjax.

See jgm/pandoc-templates#67.
EPUB, EPUB3 templates:  Handle structured metadata on titlepage.

Previously we just expected 'title', 'subtitle', 'author', 'date'.
Now we still support those, but also support the format recommended
for epub metadata in the pandoc README:

    ---
    title:
    - type: main
      text: My Book
    - type: subtitle
      text: An investigation of metadata
    creator:
    - role: author
      text: John Smith
    - role: editor
      text: Sarah Jones
    identifier:
    - scheme: DOI
      text: doi:10.234234.234/33
    publisher:  My Press
    rights:  (c) 2007 John Smith, CC BY-NC
    ...
EPUB writer: Don't use opf:title-type for epub2.

It is not supported and epubcheck complains.
README: escape (c) in epub metadata example
Markdown reader:  better handling of paragraph in div.

Previously text that ended a div would be parsed as Plain
unless there was a blank line before the closing div tag.

Test case:

    <div class="first">
    This is a paragraph.

    This is another paragraph.
    </div>

Closes #1591.
LaTeX writer: Put `~` before header in item text.

Because of the built-in line skip, LaTeX can't handle a section header
as the first element in a list item. (To be precise, it can't handle it
if the list immediately follows a section header, but the instance is
rare enough that we can afford to be a bit more general). This puts a
non-breaking space before the header to solve this problem. We won't see
this space, since the header skips a line before printing anyway.

The output is ugly in LaTeX and this structure seems like it should
probably be avoided. But it is valid HTML and native pandoc, so we
should have some sort of typesettable representation in LaTeX.
LaTeX writer: Add tests for header-in-item.
Use real copyright symbol in README epub metadata example.
EPUB writer:  Extract title even from structured title.

Added docTitle'.
Merge pull request #1594 from jkr/itemFix

Item fix
EPUB writer: Fixed typo.
LaTeX writer: Avoid using reserved characters as \lstinline delimiters.

Closes #1595.
EPUB writer: Don't include nav node in spine unless --toc was requested.

Previously we included it in the spine with `linear="no"`, leading
to odd results in some readers.

Closes #1593.
Docx reader: Fix window path for image lookup.

Don't use os-sensitive "combine", since we always want the paths in our
zip-archive to use forward-slashes.
Docx reader: Modify mediabag test accordingly.
Docx reader: Single-item headers in ordered lists are headers.

When users number their headers, Word understands that as a single item
enumerated list. We make the assumption that such a list is, in fact, a header.
Docx reader: Rewrite rewriteLink to work with new headers.

There could be new top-level headers after making lists, so we have to
rewrite links after that.
Docx Reader: Add tests for numbered headers.
Org reader: Added state changing blanklines.

This allows us to emphasize at the beginning of a new paragraph (or, in
general, after blank lines).