Fix buggy heredoc parsing (fixes #317)

This commit adds support for wrapping heredoc wrapper in quotes. This
allows custom characters to be placed in heredoc markers.