Various pandoc related improvements