Fixed choice of container on popstate

The choice of container on popstate should depend on history direction.

Consider the following scenario:
page1 --container1--> page2 --container2--> page3
1. When we go from page1 to page2, contents in container1 is cached and replaced.
1. When we go to page3, contents in container2 is cached and replaced.
Therefore:
1. When we go back to page2 (from page3), we should change the contents of container2.
2. When we go forward to page2 (from page1), we should change the contents of container1.