Use items in history by index, fixes #6
be more consistent in sorting history by frecency