Completion: greatly simplify interactive completion
Completion: update_completion() takes ownership of its parameters

And move the code so the prototype at the top can be removed.