Added a preliminary autocompletion feature.

Added a basic UI for the autocompletion. Moved several console printing
/ logging functions to more appropriate locations.