Improve completion caching

For a given completion 'session' (ie, while the current completion popup
window is visible), we now cache each set of completions generated --
this ensures the user has a smooth experience while moving forwards and
backwards through the set of candidate completions (and eliminates
flickering on backspace)