Fix multilined LaTeX within card templates

Fix issue 1935. The mungeQA method is passed a string that has been
stripped of newline characters in the "meat" of the card, but which can
still contain newlines in the templated part. Get mungeQA to handle this
properly; also, switch to case-insensitive matching for [latex] tags.
Merge pull request #166 from yshklarov/issue-1935-rc1

Fix multilined LaTeX within card templates