Maintain history state object when changing pages

This is required for history-management libraries like jquery-pjax which uses the state object to load pages via AJAX.