history engine: fix old items are always ignored
history engine: fix old items are always ignored

and rework some code according to https://v8.dev/blog/react-cliff

gdh1995/vimium-plus,gdh1995/vimium-plus,gdh1995/vimium-plus