Added back and forward history functionality.