Fixes dowsanjack/textcomplete#1, Closes dowsanjck/textcomplete#2 , one improvement in dowsanjack/textcomplete#3