Parsing:  Added HasMacros, simplified other typeclasses.

Removed updateHeaderMap, setHeaderMap, getHeaderMap,
updateIdentifierList, setIdentifierList, getIdentifierList.
LaTeX reader:  Added LPState.

Plan is to use this instead of ParserState in LP.
Revert "LaTeX reader:  Added LPState."

This reverts commit 82ddec698e782fef83dcd1b1fba79cd3b698c717.
Parsing:  Added stateCaption.

This is primarily for use in the LaTeX reader, so far.
LaTeX reader:  Better handling of figure and table with caption.

We now look for a \caption inside the environment; if one is
found, it is attached to the graphic or tabular found there.

Closes #1204.
Markdown writer:  Use longer backtick fences if needed.

If the content contains a backtick fence and there are
attributes, make sure longer fences are used to delimit the code.

Note:  This works well in pandoc, but github markdown is more
limited, and will interpret the first string of three or more
backticks as ending the code block.

Closes #1206.
Make --toc-depth work well with books in latex/pdf output.

Closes #1210.
Bugfix for #1175 and convert textile reader to use builder.

The reader did not correctly parse inline markup. The behavoir is now as follows.

(a) The markup must start at the start of a line, be inside previous
inline markup or be preceeded by whitespace.
(b) The markup can not span across paragraphs (delimited by \n\n)
(c) The markup can not be followed by a alphanumeric character.
(d) Square brackets can be placed around the markup to avoid having
to have white space before it.

In order to make these changes it was either necessary to convert the parser to return a list of inlines or to convert the whole reader to use the builder. The latter approach whilst more work makes a bit more sense as it becomes easy to arbitarily append and prepend elements without changing the type.

Tests are accordingly updated in a later commit to reflect the different normalisation behavoir specified by the builder monoid.
Converted HTML reader to use builder. Fixes #1162.
Changed the smart punctuation parser to return Inlines rather than an Inline element and updated files accordingly
Tests updated to reflect changes to readers.

Previously normalisation was handled by the `normalizeSpaces` function. The behavoir of the builder monoid is slightly different and melds together more items such as consecutive strings and spaces adjacent to line breaks. The tests have been changed to reflect this.

All relevant tests passed when the string melding line of the builder monoid was commented out.
Merge pull request #1207 from mpickering/htmlinlines

Fix #1162, #1175 and rewrite textile and HTML backend to use the builder
HTML reader: idiomatic rewriting for clarity.
Added HTML reader tests for empty strong, emph.
MediaWiki reader: Fixed bug in certain nested lists.

The bug: If a level 2 list was followed by a level 1 list, the first
item of the level 1 list would be lost.

Closes #1213.
Custom writer:  read lua script as UTF-8.

This should fix #1189.
Added caption package to default beamer template. Closes #1200.
pandoc.cabal: allow QuickCheck-2.7

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Correctly handle UTF-8 in custom lua scripts. Closes #1189.
Merge pull request #1216 from trofi/master

pandoc.cabal: allow QuickCheck-2.7