Iex limit history

I've replaced the list with a queue to be able to limit and index the history in both directions efficiently.