Change the behavior of tab completion

When pressing `TAB` cycle through the possible options. Use `Shift-TAB`
to cycle in reverse.