Fix completions.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>
Move completion code to separate code file.

Signed-off-by: Rüdiger Sonderfeld <ruediger@c-plusplus.de>