Rename finish func
Uniquify matches
Use word_start
Make prev_completion a regular var
Introduce finish_completion
use word_def
Change insert word invocation, accept direction
Refactor insert_word()
Move setting of flag
Add return statement
Rename globals
Set index properly in complete_word
Clean up insert_word()
Shorten index calculation
Fix version number
Fix hack
Simplify unhooking
Use map() on unhooking
Use tuple for hook container
Get rid of unused r