Added missed freeing for vb_get_input_text in compltion.
Moved parts of completion logic to ex.c.

This change makes it easier to control the found matches and it allowed to
complete also abbreviated commands like ':o !tag'.
Moved command_history to ex.c