fixed autocompletion shortcut not working
moved several completer functions outside of function scope for easier re-use