Adds history management

Commit adds history management for managing the browser's back/forward
button behavior when AJAX is used.