Add save/restore of jump history.

This change should also clean up some consistency bugs in history
management.