Correctly escape double-quote, also add doctests

Fixes #9.