Create functions for history management and quick command lookup