Fixed data structure corruption in the navigation history.
The way history was set up before, every time there was a history navigation
with alt-left or alt-right, a new history entry would get added onto the end
of the list. Maybe. It was hard to tell. Choice of a ring buffer to store
history made state change semantics extremely difficult to work out.
I fixed it by changing the navigation history state to a more suitable data
structure. It now uses a cursor pattern, keeping the history in two linked
lists, the past and the future.