Tab shell rewrite

Added TAB completion but resulted in some refactoring and modifications