split cache into history and a better autocompletion system