replace smart quotes before monospace, be smarter about replacements

- replace ``phrase'' and `phrase' before ``monospace`` and `monospace`
- disallow ` as first character of single-quoted phrase
- disallow ` as first character or following character of an unconstrained monospace
- update tests
- add test for two double-quoted phrases in single line