Add insertLinkWithText and start of term detection

Add insertLinkWithText and start of term detection and consolidate
keyup and key pressed into a single binding