Merged in improvements from othree/vim-autocomplpop (until commit ccab3630911b61f84d71773fbb36e146bda29587)