Add first draft of improvements to smart quote logic.