Complete refactoring of the tab-completion functionality.
Cleanup older behaviour and remove stuff we no longer need (eg. inCompose,
data.contentEditable, global element reference), since we now pass most of the
required variabled directly into function params, instead of using globals.