Updated to work with pandoc >= 1.12.1

Adapted to work with the changes introduce in the Pandoc JSON serialisation format introduced in [1.12.1](https://github.com/jgm/pandoc/releases/tag/1.12.1)

I have successfully tested this on the latest Pandoc-1.12.4, but not on earlier versions.