Make HTML and CSS code completion not to overwrite the neighboring text.

This fixes issue #3005 for HTML and CSS code completion. 

Changes for HTML code completion are
 * Never replace the existing tag or attribute name or just plain text if code hint is invoked at the very beginning of an existing tag or attribute name or just plain text.
 * Replace an existing tag, or attribute name/value if it is invoked when the cursor is inside (or at the end of)  an existing tag or attribute name/value.
 * Always replace an existing attribute value even if it is invoked from the very beginning of the attribute value. (ie. after the ``=`` or ``"`` or ``'``) However, if it is triggered by typing everything from tag name until the ``=``, then any word after the ``=`` is not replaced. For example, if the user types ``<a dir=`` before ``myEmail@address.com`` and select an attribute value from the hint list, ``myEmail@address.com`` will not be replaced.

Changes for CSS code completion are
 * Never replace an existing property name when invoking the CSS hints from the very beginning of an existing one with Ctrl+Space.
 * Never replace an existing property name when invoking the CSS  hints by typing a letter before an existing property name. (eg. typing ``m`` in front of ``display: none;``)
 * Always replace an existing property value regardless of invoking it from any cursor position. (ie. no change for property value hinting)