Rewrite " ` ' to typographic quotes with JavaScript

Also fix two instances in the source that the heuristic got wrong.